Skip to content

Commit

Permalink
Mention secrets only once
Browse files Browse the repository at this point in the history
Signed-off-by: Jonathan Beri <[email protected]>
  • Loading branch information
beriberikix committed Dec 26, 2024
1 parent 986c508 commit 7c60c62
Showing 1 changed file with 8 additions and 14 deletions.
22 changes: 8 additions & 14 deletions docs/data-routing/5-examples/24-supabase.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@ real-time subscriptions, authentication, storage, and serverless functions, all
managed through a single interface. Supabase provides multiple ways to consume
data from Golioth.

The following examples will need credentials from Supabase. Create two
[secrets](/data-routing/secrets) based on the
[Service Role Key](https://supabase.com/docs/guides/api/api-keys#the-servicerole-key).
`$SUPABASE_KEY` should be the the Server Role Key while `$SUPABASE_SERVICE_KEY`
should take the form of 'Bearer
$Service_Role_Key'. For example, if the `Service Role Key` is `12345` than the `$SUPABASE_SERVICE_KEY`should be set to`Bearer
12345`.

The first example is the simplest and uses the
[REST API](https://supabase.com/docs/guides/api). Assuming a database named
`golioth_pipeline_basic` with the following columns:
Expand All @@ -22,13 +30,6 @@ Create the following Pipeline:

<Pipeline link='https://console.golioth.io/pipeline?name=Supabase%20REST%20API%20Example&pipeline=c3RlcHM6CiAgLSBuYW1lOiBzdGVwMAogICAgZGVzdGluYXRpb246CiAgICAgIHR5cGU6IHdlYmhvb2sKICAgICAgdmVyc2lvbjogdjEKICAgICAgcGFyYW1ldGVyczoKICAgICAgICB1cmw6IGh0dHBzOi8vcmdnY3Fvc2x0cW9wY3d0d3doa2Muc3VwYWJhc2UuY28vZnVuY3Rpb25zL3YxL2dvbGlvdGgtcGlwZWxpbmUKICAgICAgICBoZWFkZXJzOgogICAgICAgICAgQXV0aG9yaXphdGlvbjogJFNVUEFCQVNFX0FVVEhfSEVBREVSCiAgICAgICAgICBhcGlrZXk6ICRTVVBBQkFTRV9BUElfS0VZCg=='/>

Create two [secrets](/data-routing/secrets) based on the
[Service Role Key](https://supabase.com/docs/guides/api/api-keys#the-servicerole-key).
`$SUPABASE_KEY` should be the the Server Role Key while `$SUPABASE_SERVICE_KEY`
should take the form of 'Bearer
$Service_Role_Key'. For example, if the `Service Role Key` is `12345` than the `$SUPABASE_SERVICE_KEY`should be set to`Bearer
12345`.

The second example uses
[Edge Functions](https://supabase.com/docs/guides/functions). While
[Transformers](/data-routing/transformers) can be used to modify data, Edge
Expand All @@ -44,13 +45,6 @@ Create the following Pipeline:

<Pipeline link='https://console.golioth.io/pipeline?name=Supabase%20Edge%20Function%20Example&pipeline=c3RlcHM6CiAgLSBuYW1lOiBzdGVwMAogICAgZGVzdGluYXRpb246CiAgICAgIHR5cGU6IHdlYmhvb2sKICAgICAgdmVyc2lvbjogdjEKICAgICAgcGFyYW1ldGVyczoKICAgICAgICB1cmw6IGh0dHBzOi8vcmdnY3Fvc2x0cW9wY3d0d3doa2Muc3VwYWJhc2UuY28vZnVuY3Rpb25zL3YxL2dvbGlvdGgtcGlwZWxpbmUKICAgICAgICBoZWFkZXJzOgogICAgICAgICAgQXV0aG9yaXphdGlvbjogJFNVUEFCQVNFX0FVVEhfSEVBREVSCiAgICAgICAgICBhcGlrZXk6ICRTVVBBQkFTRV9BUElfS0VZCg=='/>

Reuse or create two [secrets](/data-routing/secrets) based on the
[Service Role Key](https://supabase.com/docs/guides/api/api-keys#the-servicerole-key).
`$SUPABASE_KEY` should be the the Server Role Key while `$SUPABASE_SERVICE_KEY`
should take the form of 'Bearer
$Service_Role_Key'. For example, if the `Service Role Key` is `12345` than the `$SUPABASE_SERVICE_KEY`should be set to`Bearer
12345`.

Create a new Edge Function called `golioth-pipelines` with the following code:

```ts
Expand Down

0 comments on commit 7c60c62

Please sign in to comment.