Skip to content

Sequin guide updates #1371

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Oct 1, 2024
Merged
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
3 changes: 0 additions & 3 deletions docs/guides/frameworks/introduction.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,11 @@ import CardNodejs from "/snippets/card-nodejs.mdx";
import CardNextjs from "/snippets/card-nextjs.mdx";
import CardRemix from "/snippets/card-remix.mdx";
import CardSupabase from "/snippets/card-supabase.mdx";
import CardSequin from "/snippets/card-sequin.mdx";

<CardGroup cols={3}>
<CardBun />
<CardNodejs />
<CardNextjs />
<CardRemix />
<CardSequin />
<CardSupabase />

</CardGroup>
16 changes: 7 additions & 9 deletions docs/guides/frameworks/sequin.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ icon: "database"

Often, task runs coincide with database changes. For instance, you might want to use a Trigger.dev task to generate an embedding for each post in your database:

<Frame>
<img src="/images/sequin-intro.svg" alt="Sequin and Trigger.dev Overview" />
</Frame>
<img src="/images/sequin-intro.png" alt="Sequin and Trigger.dev Overview" />

In this guide, you'll learn how to use Sequin to trigger Trigger.dev tasks from database changes.

Expand Down Expand Up @@ -119,7 +117,7 @@ Start by creating a new Trigger.dev task that takes in a Sequin change event as
```
</CodeGroup>

This task takes in a Sequin record event, creates an embedding, and then uppserts the embedding into a `post_embeddings` table.
This task takes in a Sequin record event, creates an embedding, and then upserts the embedding into a `post_embeddings` table.
</Step>
<Step title="Add the task to your Trigger.dev project">
Register the `create-embedding-for-post` task to your Trigger.dev cloud project by running the following command:
Expand Down Expand Up @@ -184,7 +182,7 @@ This guide covers how to setup an API endpoint using the Next.js App Router. You
DATABASE_URL=postgresql://
```

The `SEQUIN_WEBHOOK_SECRET` ensures that only Sequin can access your APIendpoint.
The `SEQUIN_WEBHOOK_SECRET` ensures that only Sequin can access your API endpoint.

The `TRIGGER_SECRET_KEY` is used to authenticate requests to Trigger.dev and can be found in the **API keys** tab of the Trigger.dev dashboard.

Expand All @@ -205,7 +203,7 @@ You'll now configure Sequin to send every row in your `posts` table to your Trig
1. Login to your Sequin account and click the **Add New Database** button.
2. Enter the connection details for your Postgres database.
<Info>
If you need to connect to a local dev database, flip the **use localhost** switch and follow the instructions to create a tunnel using the [Sequin CLI](/cli).
If you need to connect to a local dev database, flip the **use localhost** switch and follow the instructions to create a tunnel using the [Sequin CLI](https://sequinstream.com/docs/cli).
</Info>
3. Follow the instructions to create a publication and a replication slot by running two SQL commands in your database:

Expand All @@ -219,14 +217,14 @@ You'll now configure Sequin to send every row in your `posts` table to your Trig
Sequin will connect to your database and ensure that it's configured properly.

<Note>
If you need step-by-step connection instructions to connect Sequin to your database, check out our [quickstart guide](/quickstart).
If you need step-by-step connection instructions to connect Sequin to your database, check out our [quickstart guide](https://sequinstream.com/docs/quickstart).
</Note>
</Step>
<Step title="Tunnel to your local endpoint">
Now, create a tunnel to your local endpoint so Sequin can deliver change payloads to your local API:

1. In the Sequin console, open the **HTTP Endpoint** tab and click the **Create HTTP Endpoint** button.
2. Enter a name for your endpoint (i.e. `local_endpoint`) and flip the **Use localhost** switch. Follow the instructions in the Sequin console to [install the Sequin CLI](/cli), then run:
2. Enter a name for your endpoint (i.e. `local_endpoint`) and flip the **Use localhost** switch. Follow the instructions in the Sequin console to [install the Sequin CLI](https://sequinstream.com/docs/cli), then run:

```bash
sequin tunnel --ports=3001:local_endpoint
Expand Down Expand Up @@ -297,7 +295,7 @@ You'll now configure Sequin to send every row in your `posts` table to your Trig
```
</Step>
<Step title="Observe the task run in the Trigger.dev dashboard">
Finally, in the Trigger.dev dashboard, navigate to the [**Runs**](https://trigger.dev/runs) tab and confirm that the task run completed successfully:
Finally, in the [**Trigger.dev dashboard**](https://cloud.trigger.dev/), navigate to the Runs page and confirm that the task run completed successfully:

<Frame>
<img src="/images/sequin-final-run.png" alt="Task run" />
Expand Down
Binary file added docs/images/sequin-intro.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading