-
Notifications
You must be signed in to change notification settings - Fork 0
P-1953 Add Formo Analytics SDK examples across multiple frameworks #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
46e7ce1
refactor: consolidate all example repos into monorepo
claude ec32549
fix: address review feedback and update READMEs for monorepo
claude d7dc61a
fix: remove duplicate heading in with-next-page-router README
claude e984f43
fix: add wagmi config to FormoAnalyticsProvider and use env var for p…
claude f9e070d
fix: reorder providers in with-farcaster to match other examples
claude f6d1e64
chore: update @formo/analytics to ^1.27.0 across all examples
claude 63808b8
chore: add .gitignore to each example directory
claude a06b60e
fix: add missing config files to with-next-app-router example
claude a512b42
Remove redundant .env.*.local patterns from root .gitignore
claude 0557ab0
iterate
yosriady e1efb00
feat: port metamask, thirdweb, and web3-onboard examples
yosriady 1623156
fix: resolve build errors across all examples
yosriady df64908
fixes
yosriady 48e5417
ci: add build workflow for all examples
yosriady eda9810
fix: add null check for analytics in farcaster custom track event
yosriady df403d0
fix: resolve CI build failures and BigInt crash
yosriady 784d7d8
fix: skip husky in CI and drop --immutable for next-app-router
yosriady File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,143 @@ | ||
| name: Build Examples | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
| pull_request: | ||
| branches: [main] | ||
|
|
||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| include: | ||
| - name: with-react | ||
| dir: with-react | ||
| pm: yarn | ||
| build: build | ||
| node: 20 | ||
|
|
||
| - name: with-next-app-router | ||
| dir: with-next-app-router | ||
| pm: yarn-berry | ||
| build: next:build | ||
| node: 20 | ||
|
|
||
| - name: with-next-page-router | ||
| dir: with-next-page-router | ||
| pm: npm | ||
| build: build | ||
| node: 20 | ||
|
|
||
| - name: with-dynamic | ||
| dir: with-dynamic | ||
| pm: npm | ||
| build: build | ||
| node: 20 | ||
|
|
||
| - name: with-farcaster | ||
| dir: with-farcaster | ||
| pm: yarn | ||
| build: build | ||
| node: 22 | ||
|
|
||
| - name: with-metamask | ||
| dir: with-metamask | ||
| pm: npm | ||
| build: build | ||
| node: 20 | ||
|
|
||
| - name: with-porto | ||
| dir: with-porto | ||
| pm: npm | ||
| build: build | ||
| node: 20 | ||
|
|
||
| - name: with-privy | ||
| dir: with-privy | ||
| pm: pnpm | ||
| build: build | ||
| node: 20 | ||
|
|
||
| - name: with-reown | ||
| dir: with-reown | ||
| pm: pnpm | ||
| build: build | ||
| node: 20 | ||
|
|
||
| - name: with-thirdweb | ||
| dir: with-thirdweb | ||
| pm: npm-legacy-peer-deps | ||
| build: build | ||
| node: 20 | ||
|
|
||
| - name: with-web3-onboard | ||
| dir: with-web3-onboard | ||
| pm: npm | ||
| build: build | ||
| node: 20 | ||
|
|
||
| # with-solana: requires @formo/analytics@1.28.0 (not yet published) | ||
| # with-react-native: requires @formo/react-native-analytics (not yet published) | ||
|
|
||
| name: ${{ matrix.name }} | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: ${{ matrix.node }} | ||
|
|
||
| - name: Install pnpm | ||
| if: matrix.pm == 'pnpm' | ||
| uses: pnpm/action-setup@v4 | ||
| with: | ||
| version: 9 | ||
|
|
||
| - name: Setup env files | ||
| working-directory: ${{ matrix.dir }} | ||
| shell: bash | ||
| run: | | ||
| if [ -f .env.example ]; then | ||
| sed 's/=$/=ci_test_key/' .env.example | \ | ||
| sed 's/=your_[a-z_]*_here$/=ci_test_key/' | \ | ||
| sed 's/="your_[a-z_]*"$/=ci_test_key/' | \ | ||
| sed 's/=your-[a-z-]*$/=ci_test_key/' > .env | ||
| fi | ||
|
|
||
| - name: Setup nested env (next-app-router) | ||
| if: matrix.name == 'with-next-app-router' | ||
| shell: bash | ||
| run: | | ||
| echo "NEXT_PUBLIC_FORMO_ANALYTICS_WRITE_KEY=ci_test_key" > with-next-app-router/packages/nextjs/.env | ||
|
|
||
| - name: Install dependencies | ||
| working-directory: ${{ matrix.dir }} | ||
| shell: bash | ||
| env: | ||
| PM: ${{ matrix.pm }} | ||
| HUSKY: "0" | ||
| run: | | ||
| case "$PM" in | ||
| yarn) yarn install --frozen-lockfile ;; | ||
| yarn-berry) yarn install ;; | ||
| pnpm) pnpm install --frozen-lockfile ;; | ||
| npm-legacy-peer-deps) npm ci --legacy-peer-deps ;; | ||
| *) npm ci ;; | ||
| esac | ||
|
|
||
| - name: Build | ||
| working-directory: ${{ matrix.dir }} | ||
| shell: bash | ||
| env: | ||
| BUILD_SCRIPT: ${{ matrix.build }} | ||
| PM: ${{ matrix.pm }} | ||
| CI: false | ||
| run: | | ||
| case "$PM" in | ||
| yarn|yarn-berry) yarn "$BUILD_SCRIPT" ;; | ||
| pnpm) pnpm run "$BUILD_SCRIPT" ;; | ||
| *) npm run "$BUILD_SCRIPT" ;; | ||
| esac |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,79 @@ | ||
| # Dependencies | ||
| node_modules | ||
| .pnp | ||
| .pnp.js | ||
| .yarn/* | ||
| !.yarn/patches | ||
| !.yarn/plugins | ||
| !.yarn/releases | ||
| !.yarn/sdks | ||
| !.yarn/versions | ||
| .yarn/install-state.gz | ||
|
|
||
| # Testing | ||
| coverage | ||
|
|
||
| # Next.js | ||
| .next | ||
| out | ||
|
|
||
| # Vite | ||
| dist | ||
| dist-ssr | ||
|
|
||
| # Production build | ||
| build | ||
|
|
||
| # Expo / React Native | ||
| .expo | ||
| web-build | ||
| *.orig.* | ||
| *.jks | ||
| *.p8 | ||
| *.p12 | ||
| *.key | ||
| *.mobileprovision | ||
| .metro-health-check* | ||
| android/app/build | ||
| ios/build | ||
| *.apk | ||
| *.aab | ||
| *.ipa | ||
| .easignore | ||
| expo-env.d.ts | ||
|
|
||
| # Debug logs | ||
| npm-debug.log* | ||
| yarn-debug.log* | ||
| yarn-error.log* | ||
| pnpm-debug.log* | ||
| lerna-debug.log* | ||
| *.log | ||
| logs | ||
|
|
||
| # Environment files | ||
| .env | ||
| *.local | ||
|
|
||
| # Vercel | ||
| .vercel | ||
|
|
||
| # TypeScript | ||
| *.tsbuildinfo | ||
| next-env.d.ts | ||
|
|
||
| # ESLint | ||
| .eslintcache | ||
|
|
||
| # Misc | ||
| .DS_Store | ||
| *.pem | ||
| *.suo | ||
| *.ntvs* | ||
| *.njsproj | ||
| *.sln | ||
| *.sw? | ||
|
|
||
| # IDE | ||
| .vscode | ||
| .idea | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| MIT License | ||
|
|
||
| Copyright (c) 2025 Formo | ||
|
|
||
| Permission is hereby granted, free of charge, to any person obtaining a copy | ||
| of this software and associated documentation files (the "Software"), to deal | ||
| in the Software without restriction, including without limitation the rights | ||
| to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
| copies of the Software, and to permit persons to whom the Software is | ||
| furnished to do so, subject to the following conditions: | ||
|
|
||
| The above copyright notice and this permission notice shall be included in all | ||
| copies or substantial portions of the Software. | ||
|
|
||
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
| OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
| SOFTWARE. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,27 @@ | ||
| # examples | ||
| # Formo Examples | ||
|
|
||
| A collection of example applications demonstrating [Formo Analytics SDK](https://formo.so) integrations across different frameworks and platforms. | ||
|
|
||
| Check out the [SDK docs](https://docs.formo.so/sdks/web) for full installation instructions and configuration options. | ||
|
|
||
| ## Web Frameworks | ||
|
|
||
| - [with-react](./with-react) - React (Create React App) app | ||
| - [with-next-app-router](./with-next-app-router) - Next.js with App Router | ||
| - [with-next-page-router](./with-next-page-router) - Next.js with Pages Router | ||
|
|
||
| ## Wallet Integrations | ||
|
|
||
| - [with-privy](./with-privy) - Next.js with Privy embedded wallets | ||
| - [with-dynamic](./with-dynamic) - React (Vite) with Dynamic.xyz wallet | ||
| - [with-reown](./with-reown) - Next.js with Reown AppKit (WalletConnect) | ||
| - [with-porto](./with-porto) - Next.js with Porto wallet | ||
|
|
||
| ## Blockchain Platforms | ||
|
|
||
| - [with-solana](./with-solana) - Next.js with Solana wallet adapter | ||
| - [with-farcaster](./with-farcaster) - Vite with Farcaster Mini App | ||
|
|
||
| ## Mobile | ||
|
|
||
| - [with-react-native](./with-react-native) - React Native (Expo) app |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| # Dynamic.xyz Environment ID | ||
| # Get your environment ID at https://app.dynamic.xyz | ||
| VITE_DYNAMIC_ENVIRONMENT_ID=your_dynamic_environment_id_here | ||
|
|
||
| # Formo Write Key | ||
| # Get your write key at https://app.formo.so | ||
| VITE_FORMO_WRITE_KEY=your_formo_write_key_here |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| node_modules | ||
| dist | ||
| dist-ssr | ||
|
|
||
| *.log | ||
| npm-debug.log* | ||
| yarn-debug.log* | ||
| pnpm-debug.log* | ||
|
|
||
| .env | ||
| .env.local | ||
| .env.*.local | ||
|
|
||
| .vscode | ||
| .idea | ||
| .DS_Store | ||
| *.tsbuildinfo |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.