Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions llms-full.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15592,6 +15592,29 @@ const client = new Client({
});
```

The token is optional. If you leave it out, the client reads `QSTASH_TOKEN`,
`QSTASH_URL` and their [region-prefixed variants](/docs/qstash/howto/multi-region)
from the environment, and only warns when it finds nothing:

```typescript
const client = new Client();
```

Use `Client.fromEnv()` if you would rather fail fast:

```typescript
const client = Client.fromEnv();
// throws: [Upstash QStash] Unable to find environment variable: QSTASH_TOKEN.
```

<Note>
`fromEnv` reads `process.env`, so on runtimes where credentials only exist as
bindings (Cloudflare Workers) pass the token to `new Client()` instead.
</Note>

No credentials at all? You don't need any while developing — see
[Local development](#local-development) below.

#### RetryConfig

You can configure the retry policy of the client by passing the configuration to the client constructor.
Expand Down
23 changes: 23 additions & 0 deletions qstash/sdks/ts/gettingstarted.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,29 @@ const client = new Client({
});
```

The token is optional. If you leave it out, the client reads `QSTASH_TOKEN`,
`QSTASH_URL` and their [region-prefixed variants](/qstash/howto/multi-region)
from the environment, and only warns when it finds nothing:

```typescript
const client = new Client();
```

Use `Client.fromEnv()` if you would rather fail fast:

```typescript
const client = Client.fromEnv();
// throws: [Upstash QStash] Unable to find environment variable: QSTASH_TOKEN.
```

<Note>
`fromEnv` reads `process.env`, so on runtimes where credentials only exist as
bindings (Cloudflare Workers) pass the token to `new Client()` instead.
</Note>

No credentials at all? You don't need any while developing — see
[Local development](#local-development) below.

#### RetryConfig

You can configure the retry policy of the client by passing the configuration to the client constructor.
Expand Down