Skip to content

Commit ca05a54

Browse files
authored
add missing imports to overview.mdx (#1731)
added missing imports: import { auth } from "@trigger.dev/sdk/v3"; import { tasks } from "@trigger.dev/sdk/v3";
1 parent 8044433 commit ca05a54

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

docs/frontend/overview.mdx

+18
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ You can use our [React hooks](/frontend/react-hooks) in your frontend applicatio
1111
To create a Public Access Token, you can use the `auth.createPublicToken` function in your **backend** code:
1212

1313
```tsx
14+
import { auth } from "@trigger.dev/sdk/v3";
15+
1416
const publicToken = await auth.createPublicToken(); // 👈 this public access token has no permissions, so is pretty useless!
1517
```
1618

@@ -19,6 +21,8 @@ const publicToken = await auth.createPublicToken(); // 👈 this public access t
1921
By default a Public Access Token has no permissions. You must specify the scopes you need when creating a Public Access Token:
2022

2123
```ts
24+
import { auth } from "@trigger.dev/sdk/v3";
25+
2226
const publicToken = await auth.createPublicToken({
2327
scopes: {
2428
read: {
@@ -31,6 +35,8 @@ const publicToken = await auth.createPublicToken({
3135
This will allow the token to read all runs, which is probably not what you want. You can specify only certain runs by passing an array of run IDs:
3236

3337
```ts
38+
import { auth } from "@trigger.dev/sdk/v3";
39+
3440
const publicToken = await auth.createPublicToken({
3541
scopes: {
3642
read: {
@@ -43,6 +49,8 @@ const publicToken = await auth.createPublicToken({
4349
You can scope the token to only read certain tasks:
4450

4551
```ts
52+
import { auth } from "@trigger.dev/sdk/v3";
53+
4654
const publicToken = await auth.createPublicToken({
4755
scopes: {
4856
read: {
@@ -55,6 +63,8 @@ const publicToken = await auth.createPublicToken({
5563
Or tags:
5664

5765
```ts
66+
import { auth } from "@trigger.dev/sdk/v3";
67+
5868
const publicToken = await auth.createPublicToken({
5969
scopes: {
6070
read: {
@@ -67,6 +77,8 @@ const publicToken = await auth.createPublicToken({
6777
Or a specific batch of runs:
6878

6979
```ts
80+
import { auth } from "@trigger.dev/sdk/v3";
81+
7082
const publicToken = await auth.createPublicToken({
7183
scopes: {
7284
read: {
@@ -79,6 +91,8 @@ const publicToken = await auth.createPublicToken({
7991
You can also combine scopes. For example, to read runs with specific tags and for specific tasks:
8092

8193
```ts
94+
import { auth } from "@trigger.dev/sdk/v3";
95+
8296
const publicToken = await auth.createPublicToken({
8397
scopes: {
8498
read: {
@@ -94,6 +108,8 @@ const publicToken = await auth.createPublicToken({
94108
By default, Public Access Token's expire after 15 minutes. You can specify a different expiration time when creating a Public Access Token:
95109

96110
```ts
111+
import { auth } from "@trigger.dev/sdk/v3";
112+
97113
const publicToken = await auth.createPublicToken({
98114
expirationTime: "1hr",
99115
});
@@ -120,6 +136,8 @@ console.log(handle.publicAccessToken);
120136
By default, tokens returned from the `trigger` function expire after 15 minutes and have a read scope for that specific run. You can customize the expiration of the auto-generated tokens by passing a `publicTokenOptions` object to the `trigger` function:
121137

122138
```ts
139+
import { tasks } from "@trigger.dev/sdk/v3";
140+
123141
const handle = await tasks.trigger(
124142
"my-task",
125143
{ some: "data" },

0 commit comments

Comments
 (0)