---
title: "Get started with Arcjet"
titleByFramework:
  default: "Get started with Arcjet"
  astro: "Get started with Astro"
  bun: "Get started with Bun"
  bun-hono: "Get started with Bun + Hono"
  deno: "Get started with Deno"
  fastify: "Get started with Fastify"
  nest-js: "Get started with NestJS"
  next-js: "Get started with Next.js"
  node-js: "Get started with Node.js"
  node-js-express: "Get started with Node.js + Express"
  node-js-hono: "Get started with Node.js + Hono"
  nuxt: "Get started with Nuxt"
  python-fastapi: "Get started with Python + FastAPI"
  python-flask: "Get started with Python + Flask"
  react-router: "Get started with React Router"
  remix: "Get started with Remix"
  sveltekit: "Get started with SvelteKit"
description: "Getting started with Arcjet. Quick start guide to protect your app from attacks, apply a rate limit, and prevent bots from accessing your Astro, Bun, Deno, Fastify, NestJS, Next.js, Node.js, Nuxt, React Router, Remix, or SvelteKit app."
prev: false
next: false
frameworks:
  - astro
  - bun
  - bun-hono
  - deno
  - fastify
  - nest-js
  - next-js
  - node-js
  - node-js-express
  - node-js-hono
  - nuxt
  - python-fastapi
  - python-flask
  - react-router
  - remix
  - sveltekit
ajToc:
  - text: 0. Get Started
    anchor: "0-get-started"
  - text: 1. Install Arcjet
    anchor: "1-install-arcjet"
  - text: 2. Set your key
    anchor: "2-set-your-key"
  - text: 3. Add rules
    anchor: "3-add-rules"
  - text: 4. Start app
    anchor: "4-start-app"
  - text: "FAQs"
    anchor: "faqs"
  - text: "What next?"
    anchor: "what-next"
  - text: "Get help"
    anchor: "get-help"
---

import { YouTube } from "astro-embed";
import SlotByFramework from "@/components/SlotByFramework";
import FrameworkLinks from "@/components/FrameworkLinks";
import { LinkButton, LinkCard, CardGrid } from "@astrojs/starlight/components";
import FAQs from "/src/components/FAQs.astro";
import WhatIsArcjet from "/src/components/WhatIsArcjet.astro";
import SdkReferenceLinkByFramework from "/src/components/SdkReferenceLinkByFramework.astro";

import AstroStep1 from "@/snippets/shared/astro/Install.mdx";
import AstroRequirements from "@/snippets/get-started/astro/Requirements.mdx";
import AstroStep2 from "@/snippets/get-started/astro/Step2.mdx";
import AstroStep3 from "@/snippets/get-started/astro/Step3.mdx";
import AstroStep4 from "@/snippets/get-started/astro/Step4.mdx";

import BunStep1 from "@/snippets/get-started/bun/Step1.mdx";
import BunRequirements from "@/snippets/get-started/bun/Requirements.mdx";
import BunStep2 from "@/snippets/get-started/bun/Step2.mdx";
import BunStep3 from "@/snippets/get-started/bun/Step3.mdx";
import BunStep4 from "@/snippets/get-started/bun/Step4.mdx";

import BunHonoStep1 from "@/snippets/get-started/bun-hono/Step1.mdx";
import BunHonoRequirements from "@/snippets/get-started/bun-hono/Requirements.mdx";
import BunHonoStep2 from "@/snippets/get-started/bun-hono/Step2.mdx";
import BunHonoStep3 from "@/snippets/get-started/bun-hono/Step3.mdx";
import BunHonoStep4 from "@/snippets/get-started/bun-hono/Step4.mdx";

import DenoStep1 from "@/snippets/get-started/deno/Step1.mdx";
import DenoRequirements from "@/snippets/get-started/deno/Requirements.mdx";
import DenoStep2 from "@/snippets/get-started/deno/Step2.mdx";
import DenoStep3 from "@/snippets/get-started/deno/Step3.mdx";
import DenoStep4 from "@/snippets/get-started/deno/Step4.mdx";

import FastifyStep1 from "@/snippets/get-started/fastify/Step1.mdx";
import FastifyRequirements from "@/snippets/get-started/fastify/Requirements.mdx";
import FastifyStep2 from "@/snippets/get-started/fastify/Step2.mdx";
import FastifyStep3 from "@/snippets/get-started/fastify/Step3.mdx";
import FastifyStep4 from "@/snippets/get-started/fastify/Step4.mdx";

import NestJsStep1 from "@/snippets/get-started/nest-js/Step1.mdx";
import NestJsRequirements from "@/snippets/get-started/nest-js/Requirements.mdx";
import NestJsStep2 from "@/snippets/get-started/nest-js/Step2.mdx";
import NestJsStep3 from "@/snippets/get-started/nest-js/Step3.mdx";
import NestJsStep4 from "@/snippets/get-started/nest-js/Step4.mdx";

import NextJsStep1 from "@/snippets/get-started/next-js/Step1.mdx";
import NextJsRequirements from "@/snippets/get-started/next-js/Requirements.mdx";
import NextJsStep2 from "@/snippets/get-started/next-js/Step2.mdx";
import NextJsStep3 from "@/snippets/get-started/next-js/Step3.mdx";
import NextJsStep4 from "@/snippets/get-started/next-js/Step4.mdx";

import NodeJsStep1 from "@/snippets/get-started/node-js/Step1.mdx";
import NodeJsRequirements from "@/snippets/get-started/node-js/Requirements.mdx";
import NodeJsStep2 from "@/snippets/get-started/node-js/Step2.mdx";
import NodeJsStep3 from "@/snippets/get-started/node-js/Step3.mdx";
import NodeJsStep4 from "@/snippets/get-started/node-js/Step4.mdx";

import NodeJsExpressStep1 from "@/snippets/get-started/node-js-express/Step1.mdx";
import NodeJsExpressRequirements from "@/snippets/get-started/node-js-express/Requirements.mdx";
import NodeJsExpressStep2 from "@/snippets/get-started/node-js-express/Step2.mdx";
import NodeJsExpressStep3 from "@/snippets/get-started/node-js-express/Step3.mdx";
import NodeJsExpressStep4 from "@/snippets/get-started/node-js-express/Step4.mdx";

import NodeJsHonoStep1 from "@/snippets/get-started/node-js-hono/Step1.mdx";
import NodeJsHonoRequirements from "@/snippets/get-started/node-js-hono/Requirements.mdx";
import NodeJsHonoStep2 from "@/snippets/get-started/node-js-hono/Step2.mdx";
import NodeJsHonoStep3 from "@/snippets/get-started/node-js-hono/Step3.mdx";
import NodeJsHonoStep4 from "@/snippets/get-started/node-js-hono/Step4.mdx";

import NuxtStep1 from "@/snippets/shared/nuxt/Install.mdx";
import NuxtRequirements from "@/snippets/get-started/nuxt/Requirements.mdx";
import NuxtStep2 from "@/snippets/shared/nuxt/Key.mdx";
import NuxtStep3 from "@/snippets/get-started/nuxt/Step3.mdx";
import NuxtStep4 from "@/snippets/get-started/nuxt/Step4.mdx";

import PythonFastapiStep1 from "@/snippets/get-started/python-fastapi/Step1.mdx";
import PythonFastapiRequirements from "@/snippets/get-started/python-fastapi/Requirements.mdx";
import PythonFastapiStep2 from "@/snippets/get-started/python-fastapi/Step2.mdx";
import PythonFastapiStep3 from "@/snippets/get-started/python-fastapi/Step3.mdx";
import PythonFastapiStep4 from "@/snippets/get-started/python-fastapi/Step4.mdx";

import PythonFlaskStep1 from "@/snippets/get-started/python-flask/Step1.mdx";
import PythonFlaskRequirements from "@/snippets/get-started/python-flask/Requirements.mdx";
import PythonFlaskStep2 from "@/snippets/get-started/python-flask/Step2.mdx";
import PythonFlaskStep3 from "@/snippets/get-started/python-flask/Step3.mdx";
import PythonFlaskStep4 from "@/snippets/get-started/python-flask/Step4.mdx";

import ReactRouterStep1 from "@/snippets/get-started/react-router/Step1.mdx";
import ReactRouterRequirements from "@/snippets/get-started/react-router/Requirements.mdx";
import ReactRouterStep2 from "@/snippets/get-started/react-router/Step2.mdx";
import ReactRouterStep3 from "@/snippets/get-started/react-router/Step3.mdx";
import ReactRouterStep4 from "@/snippets/get-started/react-router/Step4.mdx";

import RemixStep1 from "@/snippets/get-started/remix/Step1.mdx";
import RemixRequirements from "@/snippets/get-started/remix/Requirements.mdx";
import RemixStep2 from "@/snippets/get-started/remix/Step2.mdx";
import RemixStep3 from "@/snippets/get-started/remix/Step3.mdx";
import RemixStep4 from "@/snippets/get-started/remix/Step4.mdx";

import SvelteKitStep1 from "@/snippets/get-started/sveltekit/Step1.mdx";
import SvelteKitRequirements from "@/snippets/get-started/sveltekit/Requirements.mdx";
import SvelteKitStep2 from "@/snippets/get-started/sveltekit/Step2.mdx";
import SvelteKitStep3 from "@/snippets/get-started/sveltekit/Step3.mdx";
import SvelteKitStep4 from "@/snippets/get-started/sveltekit/Step4.mdx";

[Arcjet](https://arcjet.com/) helps developers protect their apps in just a few
lines of code. Bot detection. Rate limiting. Email validation. Attack
protection. Data redaction. A developer-first approach to security.

This guide will show you how to set up a simple API server protected by Arcjet.

<SlotByFramework client:load>
  <YouTube id="CuemptpnIVQ" slot="next-js" />
</SlotByFramework>

<FrameworkLinks title="Choose a framework" client:load />

## 1. Install Arcjet

In your project root, run the following:

<SlotByFramework client:load>
  <AstroStep1 slot="astro" />
  <BunStep1 slot="bun" />
  <BunHonoStep1 slot="bun-hono" />
  <DenoStep1 slot="deno" />
  <FastifyStep1 slot="fastify" />
  <NestJsStep1 slot="nest-js" />
  <NextJsStep1 slot="next-js" />
  <NodeJsStep1 slot="node-js" />
  <NodeJsExpressStep1 slot="node-js-express" />
  <NodeJsHonoStep1 slot="node-js-hono" />
  <NuxtStep1 slot="nuxt" />
  <PythonFastapiStep1 slot="python-fastapi" />
  <PythonFlaskStep1 slot="python-flask" />
  <ReactRouterStep1 slot="react-router" />
  <RemixStep1 slot="remix" />
  <SvelteKitStep1 slot="sveltekit" />
</SlotByFramework>

### Requirements

<SlotByFramework client:load>
  <AstroRequirements slot="astro" />
  <BunRequirements slot="bun" />
  <BunHonoRequirements slot="bun-hono" />
  <DenoRequirements slot="deno" />
  <FastifyRequirements slot="fastify" />
  <NestJsRequirements slot="nest-js" />
  <NextJsRequirements slot="next-js" />
  <NodeJsRequirements slot="node-js" />
  <NodeJsExpressRequirements slot="node-js-express" />
  <NodeJsHonoRequirements slot="node-js-hono" />
  <NuxtRequirements slot="nuxt" />
  <PythonFastapiRequirements slot="python-fastapi" />
  <PythonFlaskRequirements slot="python-flask" />
  <ReactRouterRequirements slot="react-router" />
  <RemixRequirements slot="remix" />
  <SvelteKitRequirements slot="sveltekit" />
</SlotByFramework>

## 2. Set your key

[Create a free Arcjet account](https://app.arcjet.com) then follow the
instructions to add a site and get a key.

<SlotByFramework client:load>
  <AstroStep2 slot="astro" />
  <BunStep2 slot="bun" />
  <BunHonoStep2 slot="bun-hono" />
  <DenoStep2 slot="deno" />
  <FastifyStep2 slot="fastify" />
  <NestJsStep2 slot="nest-js" />
  <NextJsStep2 slot="next-js" />
  <NodeJsStep2 slot="node-js" />
  <NodeJsExpressStep2 slot="node-js-express" />
  <NodeJsHonoStep2 slot="node-js-hono" />
  <NuxtStep2 slot="nuxt" />
  <PythonFastapiStep2 slot="python-fastapi" />
  <PythonFlaskStep2 slot="python-flask" />
  <ReactRouterStep2 slot="react-router" />
  <RemixStep2 slot="remix" />
  <SvelteKitStep2 slot="sveltekit" />
</SlotByFramework>

## 3. Add rules

This configures Arcjet rules to protect your app from attacks, apply a rate
limit, and prevent bots from accessing your app.

<SlotByFramework client:load>
  <AstroStep3 slot="astro" />
  <BunStep3 slot="bun" />
  <BunHonoStep3 slot="bun-hono" />
  <DenoStep3 slot="deno" />
  <FastifyStep3 slot="fastify" />
  <NestJsStep3 slot="nest-js" />
  <NextJsStep3 slot="next-js" />
  <NodeJsStep3 slot="node-js" />
  <NodeJsExpressStep3 slot="node-js-express" />
  <NodeJsHonoStep3 slot="node-js-hono" />
  <NuxtStep3 slot="nuxt" />
  <PythonFastapiStep3 slot="python-fastapi" />
  <PythonFlaskStep3 slot="python-flask" />
  <ReactRouterStep3 slot="react-router" />
  <RemixStep3 slot="remix" />
  <SvelteKitStep3 slot="sveltekit" />
</SlotByFramework>

<SlotByFramework client:load>
  <AstroStep4 slot="astro" />
  <BunStep4 slot="bun" />
  <BunHonoStep4 slot="bun-hono" />
  <DenoStep4 slot="deno" />
  <FastifyStep4 slot="fastify" />
  <NestJsStep4 slot="nest-js" />
  <NextJsStep4 slot="next-js" />
  <NodeJsStep4 slot="node-js" />
  <NodeJsExpressStep4 slot="node-js-express" />
  <NodeJsHonoStep4 slot="node-js-hono" />
  <NuxtStep4 slot="nuxt" />
  <PythonFastapiStep4 slot="python-fastapi" />
  <PythonFlaskStep4 slot="python-flask" />
  <ReactRouterStep4 slot="react-router" />
  <RemixStep4 slot="remix" />
  <SvelteKitStep4 slot="sveltekit" />
</SlotByFramework>

The requests will also show in the [Arcjet dashboard](https://app.arcjet.com).

## FAQs

<FAQs />

## What next?

<CardGrid>
  <LinkCard
    title="Customize allowed bots"
    href="/bot-protection/identifying-bots"
    description="Identify bots and configure allow/deny lists."
  />
  <LinkCard
    title="Testing"
    href="/testing"
    description="Write tests for your rules."
  />
</CardGrid>

### Explore

Arcjet can be used with specific rules on individual routes or as general
protection on your entire application. You can defend from clients sending
you sensitive information, minimize fraudulent registrations with
the signup form protection and more.

<CardGrid>
  <LinkCard
    title="Example apps"
    href="https://github.com/arcjet/arcjet-js/tree/main/examples"
    description="Check out the examples."
  />
  <LinkCard
    title="Learn how Arcjet works"
    href="/architecture"
    description="Arcjet's architecture."
  />
  <SdkReferenceLinkByFramework />
</CardGrid>

## Get help

Need help with anything? [Email us](mailto:support@arcjet.com) or [join our
Discord](https://arcjet.com/discord) to get support from our engineering team.
