diff --git a/src/content/docs/environment.mdx b/src/content/docs/environment.mdx index bf41016c..821d9bb8 100644 --- a/src/content/docs/environment.mdx +++ b/src/content/docs/environment.mdx @@ -106,8 +106,35 @@ For more information, see diff --git a/src/content/docs/guards/capture.mdx b/src/content/docs/guards/capture.mdx index ae11da5a..214f6c6c 100644 --- a/src/content/docs/guards/capture.mdx +++ b/src/content/docs/guards/capture.mdx @@ -73,6 +73,18 @@ event is sent with source `"sdk"`. Do not put secrets or PII in `metadata`. It is stored as untrusted data. +## Keys + +`capture()` uses the key configured on the client. Capture accepts a site +key (`ajkey_...`) or a project collector key (`aj_prj_key_...`). + +Collector keys are ingest-only. Do not use one for `guard()` or +`protect()`, and do not set it as `ARCJET_KEY`. In production, Guard and +Decide respond `404` to a collector key. + +For more information about key types, see +Environment variables. + ## Delivery Capture is best-effort and never blocks or throws into application code: diff --git a/src/content/docs/troubleshooting.mdx b/src/content/docs/troubleshooting.mdx index 55ab2704..fb229932 100644 --- a/src/content/docs/troubleshooting.mdx +++ b/src/content/docs/troubleshooting.mdx @@ -151,12 +151,15 @@ security checks. ``` This error means that the Arcjet key you are using is invalid. Each site has a -unique key to identify it within Arcjet. You can find your key in the Arcjet -dashboard by clicking your site name and then going to the SDK installation tab. +unique site key to identify it within Arcjet. You can find your site key in the +Arcjet dashboard by clicking your site name and then going to the SDK +installation tab. -Arcjet keys are always prefixed with `ajkey_` +Site keys are prefixed with `ajkey_`. Project collector keys are prefixed +with `aj_prj_key_` and are ingest-only. Do not use a collector key as +`ARCJET_KEY` for `protect()` or `guard()`. -You provide the Arcjet SDK with the key when instantiating the client. For +You provide the Arcjet SDK with the site key when instantiating the client. For example in this case the key is defined in an environment variable called `ARCJET_KEY`: @@ -200,6 +203,15 @@ aj = arcjet( +### Collector key used for protect or guard + +A project collector key (`aj_prj_key_...`) is ingest-only. Capture and +OTLP HTTP accept it. In production, Guard and Decide respond `404`. + +Use a site key (`ajkey_...`) for `ARCJET_KEY`, `protect()`, and `guard()`. +For more information about key types, see +Environment variables. + ### [deadline_exceeded] the operation timed out ```text diff --git a/tests/screenshot.test.ts-snapshots/screenshot-troubleshooting-dark-chromium-linux.png b/tests/screenshot.test.ts-snapshots/screenshot-troubleshooting-dark-chromium-linux.png index b75770ed..d3a48759 100644 Binary files a/tests/screenshot.test.ts-snapshots/screenshot-troubleshooting-dark-chromium-linux.png and b/tests/screenshot.test.ts-snapshots/screenshot-troubleshooting-dark-chromium-linux.png differ diff --git a/tests/screenshot.test.ts-snapshots/screenshot-troubleshooting-light-chromium-linux.png b/tests/screenshot.test.ts-snapshots/screenshot-troubleshooting-light-chromium-linux.png index 37d6918f..abde8a6f 100644 Binary files a/tests/screenshot.test.ts-snapshots/screenshot-troubleshooting-light-chromium-linux.png and b/tests/screenshot.test.ts-snapshots/screenshot-troubleshooting-light-chromium-linux.png differ