This example shows how to use Arcjet with a Bun.sh server.
-
From the root of the project, install the SDK dependencies.
npm ci
-
Enter this directory and install the example's dependencies.
cd examples/bun-rate-limit bun install
-
Rename
.env.local.example
to.env.local
and add your Arcjet key. -
Start the server.
bun run --hot index.ts
-
Visit
http://localhost:3000/
. Note: If you load this in a browser, you will see 2 requests - one for the page and one for a favicon. -
Refresh the page to trigger the rate limit.