mirror of
https://github.com/supabase/supabase.git
synced 2026-12-04 07:29:16 +00:00
## Problem After #53183 and #52567 have been addressed, we should strengthen the interconnections between the UI library and the rest of the Supabase ecosystem. ## Solution - Adds contextual links for `/library`, Auth / Realtime category pages, and specific Auth / Realtime components. Hits top-level product pages, docs, kb, and blogs. ## Preview links N/A, link changes are relatively atomic so easier to review without many preview links. --------- Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
57 lines
2.2 KiB
Plaintext
57 lines
2.2 KiB
Plaintext
---
|
|
title: Realtime Avatar Stack
|
|
description: Avatar stack in realtime
|
|
preview: |-
|
|
<BlockOverview name="realtime-avatar-stack-nuxtjs" showFiles>
|
|
<BlockPreview name="realtime-avatar-stack-demo" />
|
|
</BlockOverview>
|
|
---
|
|
|
|
## Installation
|
|
|
|
### Set up the Supabase client
|
|
|
|
This block requires a Supabase client for Nuxt.js. If your project already has one, reuse it and update the block's imports to match your client. Otherwise, install the client:
|
|
|
|
<BlockItem name="supabase-client-nuxtjs" framework="vue" showOpenInV0={false} />
|
|
|
|
Configure the environment variables described in the [Nuxt.js client guide](/library/docs/nuxtjs/client#getting-started) before using the block.
|
|
|
|
### Install the block
|
|
|
|
<BlockItem name="realtime-avatar-stack-nuxtjs" framework="vue" />
|
|
|
|
## Usage
|
|
|
|
The `RealtimeAvatarStack` component renders stacked avatars which are connected to Supabase Realtime. It uses the Presence feature of Supabase Realtime. You can use this to show currently online users in a chatroom, game session or collaborative app.
|
|
|
|
```vue
|
|
<script setup lang="ts">
|
|
// Assumes you have Header component created
|
|
import Header from '@/components/Header.vue'
|
|
import RealtimeAvatarStack from '@/components/RealtimeAvatarStack.vue'
|
|
</script>
|
|
|
|
<template>
|
|
<Header class="flex items-center justify-between">
|
|
<h1>Lumon Industries</h1>
|
|
<RealtimeAvatarStack roomName="break_room" />
|
|
</Header>
|
|
</template>
|
|
```
|
|
|
|
## Props
|
|
|
|
| Prop | Type | Default | Description |
|
|
| ---------- | -------- | ------- | ---------------------------------------------------- |
|
|
| `roomName` | `string` | `null` | The name of the Supabase Realtime room to connect to |
|
|
|
|
## Further reading
|
|
|
|
- [Realtime Presence](https://supabase.com/docs/guides/realtime/presence)
|
|
- [Realtime authorization](https://supabase.com/docs/guides/realtime/authorization)
|
|
- [Getting started with Realtime](https://supabase.com/docs/guides/realtime/getting_started)
|
|
- [Realtime limits](https://supabase.com/docs/guides/realtime/limits)
|
|
- [Realtime message usage and billing](https://supabase.com/docs/guides/platform/manage-your-usage/realtime-messages)
|
|
- [Row Level Security](https://supabase.com/docs/guides/database/postgres/row-level-security)
|