Quick start (Next.js)
A quick way to see what Arcjet can do is to deploy the example app. It’s also available at example.arcjet.com. Clone the GitHub repository:Dockerfile and a fly.toml for you.
Create an Arcjet account and link it to your Fly app:
- Create an Arcjet account linked to your Fly account.
- Create an Arcjet team mapped to your Fly organization.
- Create an Arcjet site for your Fly application.
- Set
ARCJET_KEYas a secret on your Fly application.
Run locally
Arcjet protections run locally as well as when deployed to Fly. This makes it easy to test and debug security rules. Assuming you have already cloned the example and linked Arcjet to your Fly app (see above): Log into your Arcjet dashboard to get theARCJET_KEY for your app.
.env.local.example to .env.local and add your Arcjet key. If you
want to test the rate limiting authentication, you will also need to add an
Auth.js secret and create a GitHub OAuth
app.
Start the dev server
Protecting your application with Arcjet
Once you have set yourARCJET_KEY secret, you can start using Arcjet to protect your application. Arcjet supports many different web frameworks e.g. Bun, Next.js, Node.js, SvelteKit.
Node.js example
You can also find this example on GitHub.-
Install the Arcjet SDK:
-
Add a rate limit to a route in
index.ts: -
Run your application:
Python + FastAPI example
You can also find this example on GitHub.-
Install the Arcjet SDK:
-
Create a new file at
main.pywith the contents: -
Run your application with your Arcjet key in the environment: