Skip to content

Commit

Permalink
docs(bun): Update the request param on protect method (#786)
Browse files Browse the repository at this point in the history
I noticed this was incorrect in the bun doc comment.
  • Loading branch information
blaine-arcjet authored May 20, 2024
1 parent 9b85908 commit f51b8d9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
7 changes: 2 additions & 5 deletions arcjet-bun/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ tokens.
import arcjet, { tokenBucket } from "@arcjet/bun";

const aj = arcjet({
key: process.env.ARCJET_KEY!, // Get your site key from https://app.arcjet.com
key: Bun.env.ARCJET_KEY!, // Get your site key from https://app.arcjet.com
rules: [
// Create a token bucket rate limit. Other algorithms are supported.
tokenBucket({
Expand Down Expand Up @@ -82,10 +82,7 @@ request with negligible performance impact.
import arcjet, { shield } from "@arcjet/bun";

const aj = arcjet({
// Get your site key from https://app.arcjet.com
// and set it as an environment variable rather than hard coding.
// See: https://nextjs.org/docs/app/building-your-application/configuring/environment-variables
key: process.env.ARCJET_KEY,
key: Bun.env.ARCJET_KEY, // Get your site key from https://app.arcjet.com
rules: [
shield({
mode: "LIVE", // will block requests. Use "DRY_RUN" to log only
Expand Down
2 changes: 1 addition & 1 deletion arcjet-bun/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export interface ArcjetBun<Props extends PlainObject> {
* analyzed and then a decision made on whether to allow, deny, or challenge
* the request.
*
* @param req - An `IncomingMessage` provided to the request handler.
* @param request - A `Request` provided to the fetch handler.
* @param props - Additonal properties required for running rules against a request.
* @returns An {@link ArcjetDecision} indicating Arcjet's decision about the request.
*/
Expand Down

0 comments on commit f51b8d9

Please sign in to comment.