This repository contains a collection of examples that demonstrate how to use Airtop in various applications.
- Node.js 20 or higher is required to run these examples.
- pnpm is used as the package manager.
- turbo is used to build the shared packages.
- Clone this repository
- Install all dependencies by running:
pnpm install
- Build the packages by running:
turbo build:packages
You should now be able to try out the examples in this repository which are located in examples/
.
See the README.md
in each example project for more information on how to run the example.
It's recommended to have two terminals opened:
- One that runs
turbo watch build:packages
so that the shared packages are built automatically on changes. - Another that runs the example you are working on using
pnpm dev
packages/home-config/.common-env
is copied over as .env
in each example. The following environment variables are used:
SECRET_FOR_DECRYPTING_API_KEYS
: base64-encoded 32-byte random string. Meant to be used with the Airtop Portal to pass encrypted API keys for use with the Get API Key feature. Disabled for local development.EXAMPLES_SITES_COOKIE_SECRET
: 32-character random string for securing the session cookie. The default value is meant for local development only.AIRTOP_PORTAL_URL
: URL to the Airtop PortalNEXT_PUBLIC_AIRTOP_PORTAL_URL
: URL to the Airtop Portal (for client-side)
Most examples use the following:
- Airtop SDK
- Next.js
- shadcn/ui for UI components
- Tailwind CSS for styling
- zustand for client-side state management in React
- zod for input validation
- React Hook Form for forms
- Loglayer for logging (backed using
console.log
) - Inquirer.js for CLI prompts
- Biome for linting and formatting