ClientKey
Create and manage Sentry client keys.
Authentication
Section titled “Authentication”You can authenticate with Sentry in two ways:
-
Environment variable (recommended):
.env SENTRY_AUTH_TOKEN=your_auth_token -
Pass the token directly:
const key = await ClientKey("my-key", {authToken: alchemy.secret(process.env.SENTRY_AUTH_TOKEN),name: "My Key",project: "my-project",organization: "my-org",});
Get your Sentry User Auth Token.
Examples
Section titled “Examples”Minimal Example
Section titled “Minimal Example”Create a basic Sentry client key:
import { ClientKey } from "alchemy/sentry";
const key = await ClientKey("my-key", { name: "My Key", project: "my-project", organization: "my-org",});
Rate Limited Key
Section titled “Rate Limited Key”Create a client key with rate limiting:
import { ClientKey } from "alchemy/sentry";
const key = await ClientKey("rate-limited-key", { name: "Rate Limited Key", project: "my-project", organization: "my-org", rateLimit: { window: 3600, // 1 hour count: 1000, // 1000 events per hour },});
Use Case Specific Key
Section titled “Use Case Specific Key”Create a client key for a specific use case:
import { ClientKey } from "alchemy/sentry";
const key = await ClientKey("profiling-key", { name: "Profiling Key", project: "my-project", organization: "my-org", useCase: "profiling",});
Adopt Existing Key
Section titled “Adopt Existing Key”Create or adopt an existing key with the same name:
import { ClientKey } from "alchemy/sentry";
const key = await ClientKey("existing-key", { adopt: true name: "Existing Key", project: "my-project", organization: "my-org",});