Skip to content
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: 3 additions & 0 deletions .github/workflows/docs-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ concurrency:
permissions:
contents: read

env:
CI: true

jobs:
build:
runs-on: ubuntu-latest
Expand Down
8 changes: 8 additions & 0 deletions apps/docs/app/api/graphql/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { NextResponse } from 'next/server'
import { z } from 'zod'
import { ApiError, convertZodToInvalidRequestError, InvalidRequestError } from '~/app/api/utils'
import { BASE_PATH, IS_DEV } from '~/lib/constants'
import { sendToLogflare, LOGGING_CODES } from '~/lib/logger'
import { rootGraphQLSchema } from '~/resources/rootSchema'
import { createQueryDepthLimiter } from './validators'

Expand Down Expand Up @@ -154,6 +155,13 @@ export async function OPTIONS(request: Request): Promise<NextResponse> {

export async function POST(request: Request): Promise<NextResponse> {
try {
const vercelId = request.headers.get('x-vercel-id')
sendToLogflare(LOGGING_CODES.CONTENT_API_REQUEST_RECEIVED, {
vercelId,
origin: request.headers.get('Origin'),
userAgent: request.headers.get('User-Agent'),
})

const result = await handleGraphQLRequest(request)
// Do not let Vercel close the process until Sentry has flushed
// https://github.com/getsentry/sentry-javascript/issues/9626
Expand Down
4 changes: 2 additions & 2 deletions apps/docs/content/guides/realtime/broadcast.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ Go to your Supabase project's [API Settings](https://supabase.com/dashboard/proj

### Receiving Broadcast messages

You can provide a callback for the `broadcast` channel to receive message. This example will receive any `broadcast` messages that are sent to `test-channel`:
You can provide a callback for the `broadcast` channel to receive messages. This example will receive any `broadcast` messages that are sent to `test-channel`:

<Tabs
scrollable
Expand Down Expand Up @@ -469,7 +469,7 @@ You can pass configuration options while initializing the Supabase Client.

myChannel.subscribe((status) => {
if (status !== 'SUBSCRIBED') { return }
channelC.send({
myChannel.send({
type: 'broadcast',
event: 'test-my-messages',
payload: { message: 'talking to myself' },
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/content/guides/realtime/concepts.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ roomOne.send({

Other clients can receive the message in real-time by subscribing to the Channel with topic `room-one`. These clients continue to receive messages as long as they are subscribed and connected to the same Channel topic.

You can also use [Broadcast using the REST API](/docs/guides/realtime/broad cast#broadcast-using-the-rest-api) and [Broadcast using the Database](/docs/guides/realtime/broadcast#broadcast-using-the-database) to send messages to a Channel which allows you to do more advanced use-cases.
You can also use [Broadcast using the REST API](https://supabase.com/docs/guides/realtime/broadcast#broadcast-using-the-rest-api) and [Broadcast using the Database](/docs/guides/realtime/broadcast#broadcast-using-the-database) to send messages to a Channel which allows you to do more advanced use-cases.

An example use-case is sharing a user's cursor position with other clients in an online game.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ Instead of `https://project-id.supabase.co` use `https://project-id.storage.supa
objectName: fileName,
contentType: 'image/png',
cacheControl: 3600,
metadata: JSON.stringify({ // custom metadata passed to the user_metadata column
yourCustomMetadata: true,
}),
},
chunkSize: 6 * 1024 * 1024, // NOTE: it must be set to 6MB (for now) do not change it
onError: function (error) {
Expand Down Expand Up @@ -159,6 +162,7 @@ Instead of `https://project-id.supabase.co` use `https://project-id.storage.supa
"objectName",
"contentType",
"cacheControl",
"metadata",
], // Metadata fields allowed for the upload
onError: (error) => console.error("Upload error:", error), // Error handling for uploads
}).on("file-added", (file) => {
Expand All @@ -168,6 +172,9 @@ Instead of `https://project-id.supabase.co` use `https://project-id.storage.supa
bucketName, // Bucket specified by the user of the hook
objectName: file.name, // Use file name as object name
contentType: file.type, // Set content type based on file MIME type
metadata: JSON.stringify({ // custom metadata passed to the user_metadata column
yourCustomMetadata: true,
}),
};
});
};
Expand Down
Loading
Loading