Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
143 changes: 143 additions & 0 deletions .github/workflows/build.yml
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
79 changes: 79 additions & 0 deletions .gitignore
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
21 changes: 21 additions & 0 deletions LICENSE.md
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.
28 changes: 27 additions & 1 deletion README.md
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
7 changes: 7 additions & 0 deletions with-dynamic/.env.example
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
17 changes: 17 additions & 0 deletions with-dynamic/.gitignore
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
Loading