mirror of
https://github.com/supabase/supabase.git
synced 2026-10-05 17:35:10 +03:00
move to the new v2 spec
This commit is contained in:
1 parent
cc05a83072
commit
e4de216664
48 files changed
+99430
-29257
No files matched your search
@@ -8,6 +8,10 @@ custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_
|
||||
import Tabs from '@theme/Tabs'
|
||||
import TabItem from '@theme/TabItem'
|
||||
|
||||
Creates a new user.
|
||||
|
||||
This function should only be called on a server. Never expose your `service_role` key in the browser.
|
||||
|
||||
```js
|
||||
const { data: user, error } = await supabase.auth.api.createUser({
|
||||
email: 'user@email.com',
|
||||
@@ -34,7 +38,7 @@ const { data: user, error } = await supabase.auth.api.createUser({
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
No description provided.
|
||||
The data you want to create the user with.
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@@ -8,6 +8,10 @@ custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_
|
||||
import Tabs from '@theme/Tabs'
|
||||
import TabItem from '@theme/TabItem'
|
||||
|
||||
Delete a user. Requires a `service_role` key.
|
||||
|
||||
This function should only be called on a server. Never expose your `service_role` key in the browser.
|
||||
|
||||
```js
|
||||
const { data: user, error } = await supabase.auth.api.deleteUser(
|
||||
'715ed5db-f090-4b8c-a067-640ecee36aa0'
|
||||
@@ -32,7 +36,7 @@ const { data: user, error } = await supabase.auth.api.deleteUser(
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
No description provided.
|
||||
The user uid you want to remove.
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@@ -8,6 +8,8 @@ custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_
|
||||
import Tabs from '@theme/Tabs'
|
||||
import TabItem from '@theme/TabItem'
|
||||
|
||||
Generates links to be sent via email or other.
|
||||
|
||||
## Parameters
|
||||
|
||||
<ul className="method-list-group">
|
||||
@@ -26,7 +28,7 @@ import TabItem from '@theme/TabItem'
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
No description provided.
|
||||
The link type ("signup" or "magiclink" or "recovery" or "invite").
|
||||
|
||||
</div>
|
||||
|
||||
@@ -46,7 +48,7 @@ No description provided.
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
No description provided.
|
||||
The user's email.
|
||||
|
||||
</div>
|
||||
|
||||
@@ -87,7 +89,7 @@ No description provided.
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
No description provided.
|
||||
Optional user metadata. For signup only.
|
||||
|
||||
</div>
|
||||
|
||||
@@ -107,7 +109,7 @@ No description provided.
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
No description provided.
|
||||
User password. For signup only.
|
||||
|
||||
</div>
|
||||
|
||||
@@ -127,7 +129,7 @@ No description provided.
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
No description provided.
|
||||
The link type ("signup" or "magiclink" or "recovery" or "invite").
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@@ -8,6 +8,12 @@ custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_
|
||||
import Tabs from '@theme/Tabs'
|
||||
import TabItem from '@theme/TabItem'
|
||||
|
||||
Gets the current user details.
|
||||
|
||||
This method is called by the GoTrueClient `update` where
|
||||
the jwt is set to this.currentSession.access_token
|
||||
and therefore, acts like getting the currently authenticated user
|
||||
|
||||
```js
|
||||
const { user, error } = await supabase.auth.api.getUser('ACCESS_TOKEN_JWT')
|
||||
```
|
||||
@@ -30,7 +36,7 @@ const { user, error } = await supabase.auth.api.getUser('ACCESS_TOKEN_JWT')
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
No description provided.
|
||||
A valid, logged-in JWT. Typically, the access_token for the currentSession
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@@ -8,6 +8,8 @@ custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_
|
||||
import Tabs from '@theme/Tabs'
|
||||
import TabItem from '@theme/TabItem'
|
||||
|
||||
Sends an invite link to an email address.
|
||||
|
||||
## Parameters
|
||||
|
||||
<ul className="method-list-group">
|
||||
@@ -26,7 +28,7 @@ import TabItem from '@theme/TabItem'
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
No description provided.
|
||||
The email address of the user.
|
||||
|
||||
</div>
|
||||
|
||||
@@ -67,7 +69,7 @@ No description provided.
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
No description provided.
|
||||
Optional user metadata
|
||||
|
||||
</div>
|
||||
|
||||
@@ -87,7 +89,7 @@ No description provided.
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
No description provided.
|
||||
A URL or mobile address to send the user to after they are confirmed.
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@@ -8,6 +8,10 @@ custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_
|
||||
import Tabs from '@theme/Tabs'
|
||||
import TabItem from '@theme/TabItem'
|
||||
|
||||
Get a list of users.
|
||||
|
||||
This function should only be called on a server. Never expose your `service_role` key in the browser.
|
||||
|
||||
```js
|
||||
const { data: user, error } = await supabase.auth.api.listUsers()
|
||||
```
|
||||
|
||||
@@ -8,6 +8,8 @@ custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_
|
||||
import Tabs from '@theme/Tabs'
|
||||
import TabItem from '@theme/TabItem'
|
||||
|
||||
Sends a reset request to an email address.
|
||||
|
||||
```js
|
||||
const { data, error } = await supabase.auth.api.resetPasswordForEmail(
|
||||
'user@email.com'
|
||||
@@ -32,7 +34,7 @@ const { data, error } = await supabase.auth.api.resetPasswordForEmail(
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
No description provided.
|
||||
The email address of the user.
|
||||
|
||||
</div>
|
||||
|
||||
@@ -93,7 +95,7 @@ No description provided.
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
No description provided.
|
||||
A URL or mobile address to send the user to after they are confirmed.
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@@ -8,6 +8,8 @@ custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_
|
||||
import Tabs from '@theme/Tabs'
|
||||
import TabItem from '@theme/TabItem'
|
||||
|
||||
Sends a mobile OTP via SMS. Will register the account if it doesn't already exist
|
||||
|
||||
## Parameters
|
||||
|
||||
<ul className="method-list-group">
|
||||
@@ -26,7 +28,7 @@ import TabItem from '@theme/TabItem'
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
No description provided.
|
||||
The user's phone number WITH international prefix
|
||||
|
||||
</div>
|
||||
|
||||
@@ -87,7 +89,7 @@ No description provided.
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
No description provided.
|
||||
A boolean flag to indicate whether to automatically create a user on magiclink / otp sign-ins if the user doesn't exist. Defaults to true.
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@@ -8,6 +8,8 @@ custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_
|
||||
import Tabs from '@theme/Tabs'
|
||||
import TabItem from '@theme/TabItem'
|
||||
|
||||
Updates the user data.
|
||||
|
||||
```js
|
||||
const { data: user, error } = await supabase.auth.api.updateUserById(
|
||||
'6aa5d0d4-2a9f-4483-b6c8-0cf4c6c98ac4',
|
||||
@@ -53,7 +55,9 @@ No description provided.
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
No description provided.
|
||||
The data you want to update.
|
||||
|
||||
This function should only be called on a server. Never expose your `service_role` key in the browser.
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@@ -8,6 +8,8 @@ custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_
|
||||
import Tabs from '@theme/Tabs'
|
||||
import TabItem from '@theme/TabItem'
|
||||
|
||||
Returns the session data, refreshing it if necessary.
|
||||
|
||||
```js
|
||||
const session = supabase.auth.session()
|
||||
```
|
||||
|
||||
@@ -8,6 +8,8 @@ custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_
|
||||
import Tabs from '@theme/Tabs'
|
||||
import TabItem from '@theme/TabItem'
|
||||
|
||||
Returns the user data, refreshing the session if necessary.
|
||||
|
||||
```js
|
||||
const user = supabase.auth.user()
|
||||
```
|
||||
|
||||
@@ -8,6 +8,8 @@ custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_
|
||||
import Tabs from '@theme/Tabs'
|
||||
import TabItem from '@theme/TabItem'
|
||||
|
||||
Receive a notification every time an auth event happens.
|
||||
|
||||
```js
|
||||
supabase.auth.onAuthStateChange((event, session) => {
|
||||
console.log(event, session)
|
||||
|
||||
@@ -8,6 +8,8 @@ custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_
|
||||
import Tabs from '@theme/Tabs'
|
||||
import TabItem from '@theme/TabItem'
|
||||
|
||||
Sets the session data from refresh_token and returns current Session and Error
|
||||
|
||||
```js
|
||||
function apiFunction(req, res) {
|
||||
// Assuming the access token was sent as a header "X-Supabase-Auth"
|
||||
@@ -40,7 +42,7 @@ function apiFunction(req, res) {
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
No description provided.
|
||||
a JWT token
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@@ -8,6 +8,8 @@ custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_
|
||||
import Tabs from '@theme/Tabs'
|
||||
import TabItem from '@theme/TabItem'
|
||||
|
||||
Log in an existing user via a third-party provider.
|
||||
|
||||
```js
|
||||
const { user, session, error } = await supabase.auth.signIn({
|
||||
email: 'example@email.com',
|
||||
|
||||
@@ -8,6 +8,8 @@ custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_
|
||||
import Tabs from '@theme/Tabs'
|
||||
import TabItem from '@theme/TabItem'
|
||||
|
||||
Passwordless method for logging in an existing user.
|
||||
|
||||
```js
|
||||
const { user, session, error } = await supabase.auth.signIn({
|
||||
email: 'example@email.com',
|
||||
|
||||
@@ -8,6 +8,8 @@ custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_
|
||||
import Tabs from '@theme/Tabs'
|
||||
import TabItem from '@theme/TabItem'
|
||||
|
||||
Log in an existing user, or login via a third-party provider.
|
||||
|
||||
```js
|
||||
const { user, session, error } = await supabase.auth.signIn({
|
||||
email: 'example@email.com',
|
||||
|
||||
@@ -8,6 +8,11 @@ custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_
|
||||
import Tabs from '@theme/Tabs'
|
||||
import TabItem from '@theme/TabItem'
|
||||
|
||||
Inside a browser context, `signOut()` will remove the logged in user from the browser session
|
||||
and log them out - removing all items from localstorage and then trigger a "SIGNED_OUT" event.
|
||||
|
||||
For server-side management, you can revoke all refresh tokens for a user by passing a user's JWT through to `auth.api.signOut(JWT: string)`. There is no way to revoke a user's session JWT before it automatically expires
|
||||
|
||||
```js
|
||||
const { error } = await supabase.auth.signOut()
|
||||
```
|
||||
|
||||
@@ -8,6 +8,8 @@ custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_
|
||||
import Tabs from '@theme/Tabs'
|
||||
import TabItem from '@theme/TabItem'
|
||||
|
||||
Creates a new user.
|
||||
|
||||
```js
|
||||
const { user, session, error } = await supabase.auth.signUp({
|
||||
email: 'example@email.com',
|
||||
@@ -94,7 +96,7 @@ No description provided.
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
No description provided.
|
||||
Optional user metadata.
|
||||
|
||||
</div>
|
||||
|
||||
@@ -114,7 +116,7 @@ No description provided.
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
No description provided.
|
||||
The redirect URL attached to the signup confirmation link. Does not redirect the user if it's a mobile signup.
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@@ -8,6 +8,8 @@ custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_
|
||||
import Tabs from '@theme/Tabs'
|
||||
import TabItem from '@theme/TabItem'
|
||||
|
||||
Updates user data, if there is a logged in user.
|
||||
|
||||
```js
|
||||
const { user, error } = await supabase.auth.update({ email: 'new@email.com' })
|
||||
```
|
||||
|
||||
@@ -8,7 +8,7 @@ custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_
|
||||
import Tabs from '@theme/Tabs'
|
||||
import TabItem from '@theme/TabItem'
|
||||
|
||||
Returns an array of all your channels.
|
||||
Returns all Realtime channels.
|
||||
|
||||
```js
|
||||
const subscriptions = supabase.getChannels()
|
||||
|
||||
@@ -45,8 +45,8 @@ the name of the function to invoke
|
||||
<span className="method-list-item-label-name">
|
||||
invokeOptions
|
||||
</span>
|
||||
<span className="method-list-item-label-badge false">
|
||||
optional
|
||||
<span className="method-list-item-label-badge required">
|
||||
required
|
||||
</span>
|
||||
<span className="method-list-item-validation">
|
||||
<code>FunctionInvokeOptions</code>
|
||||
@@ -54,10 +54,7 @@ the name of the function to invoke
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
object with the following properties
|
||||
`headers`: object representing the headers to send with the request
|
||||
`body`: the body of the request
|
||||
`responseType`: how the response should be parsed. The default is `json`
|
||||
No description provided.
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@@ -8,8 +8,7 @@ custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_
|
||||
import Tabs from '@theme/Tabs'
|
||||
import TabItem from '@theme/TabItem'
|
||||
|
||||
Closes and removes all channels and returns a list of removed
|
||||
channels and their errors.
|
||||
Unsubscribes and removes all Realtime channels from Realtime client.
|
||||
|
||||
```js
|
||||
supabase.removeAllChannels()
|
||||
|
||||
@@ -8,7 +8,7 @@ custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_
|
||||
import Tabs from '@theme/Tabs'
|
||||
import TabItem from '@theme/TabItem'
|
||||
|
||||
Closes and removes a channel and returns the number of open channels.
|
||||
Unsubscribes and removes Realtime channel from Realtime client.
|
||||
|
||||
```js
|
||||
supabase.removeChannel(mySubscription)
|
||||
@@ -32,7 +32,7 @@ supabase.removeChannel(mySubscription)
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
The channel you want to close and remove.
|
||||
The name of the Realtime channel.
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@@ -8,6 +8,8 @@ custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_
|
||||
import Tabs from '@theme/Tabs'
|
||||
import TabItem from '@theme/TabItem'
|
||||
|
||||
Creates a new Storage bucket
|
||||
|
||||
```js
|
||||
const { data, error } = await supabase.storage.createBucket('avatars', {
|
||||
public: false,
|
||||
@@ -32,7 +34,7 @@ const { data, error } = await supabase.storage.createBucket('avatars', {
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
No description provided.
|
||||
A unique identifier for the bucket you are creating.
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@@ -8,6 +8,9 @@ custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_
|
||||
import Tabs from '@theme/Tabs'
|
||||
import TabItem from '@theme/TabItem'
|
||||
|
||||
Deletes an existing bucket. A bucket can't be deleted with existing objects inside it.
|
||||
You must first `empty()` the bucket.
|
||||
|
||||
```js
|
||||
const { data, error } = await supabase.storage.deleteBucket('avatars')
|
||||
```
|
||||
@@ -30,7 +33,7 @@ const { data, error } = await supabase.storage.deleteBucket('avatars')
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
No description provided.
|
||||
The unique identifier of the bucket you would like to delete.
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@@ -8,6 +8,8 @@ custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_
|
||||
import Tabs from '@theme/Tabs'
|
||||
import TabItem from '@theme/TabItem'
|
||||
|
||||
Removes all objects inside a single bucket.
|
||||
|
||||
```js
|
||||
const { data, error } = await supabase.storage.emptyBucket('avatars')
|
||||
```
|
||||
@@ -30,7 +32,7 @@ const { data, error } = await supabase.storage.emptyBucket('avatars')
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
No description provided.
|
||||
The unique identifier of the bucket you would like to empty.
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@@ -8,6 +8,8 @@ custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_
|
||||
import Tabs from '@theme/Tabs'
|
||||
import TabItem from '@theme/TabItem'
|
||||
|
||||
Copies an existing file.
|
||||
|
||||
```js
|
||||
const { data, error } = await supabase.storage
|
||||
.from('avatars')
|
||||
@@ -32,7 +34,7 @@ const { data, error } = await supabase.storage
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
No description provided.
|
||||
The original file path, including the current file name. For example `folder/image.png`.
|
||||
|
||||
</div>
|
||||
|
||||
@@ -52,7 +54,7 @@ No description provided.
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
No description provided.
|
||||
The new file path, including the new file name. For example `folder/image-copy.png`.
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@@ -8,6 +8,8 @@ custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_
|
||||
import Tabs from '@theme/Tabs'
|
||||
import TabItem from '@theme/TabItem'
|
||||
|
||||
Create signed URL to download file without requiring permissions. This URL can be valid for a set number of seconds.
|
||||
|
||||
```js
|
||||
const { signedURL, error } = await supabase.storage
|
||||
.from('avatars')
|
||||
@@ -32,7 +34,7 @@ const { signedURL, error } = await supabase.storage
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
No description provided.
|
||||
The file path to be downloaded, including the current file name. For example `folder/image.png`.
|
||||
|
||||
</div>
|
||||
|
||||
@@ -52,7 +54,7 @@ No description provided.
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
No description provided.
|
||||
The number of seconds until the signed URL expires. For example, `60` for a URL which is valid for one minute.
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@@ -8,6 +8,8 @@ custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_
|
||||
import Tabs from '@theme/Tabs'
|
||||
import TabItem from '@theme/TabItem'
|
||||
|
||||
Create signed URLs to download files without requiring permissions. These URLs can be valid for a set number of seconds.
|
||||
|
||||
```js
|
||||
const { data, error } = await supabase.storage
|
||||
.from('avatars')
|
||||
@@ -32,7 +34,7 @@ const { data, error } = await supabase.storage
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
No description provided.
|
||||
The file paths to be downloaded, including the current file names. For example `['folder/image.png', 'folder2/image2.png']`.
|
||||
|
||||
</div>
|
||||
|
||||
@@ -52,7 +54,7 @@ No description provided.
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
No description provided.
|
||||
The number of seconds until the signed URLs expire. For example, `60` for URLs which are valid for one minute.
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@@ -8,6 +8,8 @@ custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_
|
||||
import Tabs from '@theme/Tabs'
|
||||
import TabItem from '@theme/TabItem'
|
||||
|
||||
Downloads a file.
|
||||
|
||||
```js
|
||||
const { data, error } = await supabase.storage
|
||||
.from('avatars')
|
||||
@@ -32,7 +34,7 @@ const { data, error } = await supabase.storage
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
No description provided.
|
||||
The file path to be downloaded, including the path and file name. For example `folder/image.png`.
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@@ -8,6 +8,8 @@ custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_
|
||||
import Tabs from '@theme/Tabs'
|
||||
import TabItem from '@theme/TabItem'
|
||||
|
||||
Retrieve URLs for assets in public buckets and encapsulates it in a return object
|
||||
|
||||
```js
|
||||
const { publicURL, error } = supabase.storage
|
||||
.from('public-bucket')
|
||||
@@ -32,7 +34,7 @@ const { publicURL, error } = supabase.storage
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
No description provided.
|
||||
The file path to be downloaded, including the path and file name. For example `folder/image.png`.
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@@ -8,6 +8,8 @@ custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_
|
||||
import Tabs from '@theme/Tabs'
|
||||
import TabItem from '@theme/TabItem'
|
||||
|
||||
Lists all the files within a bucket.
|
||||
|
||||
```js
|
||||
const { data, error } = await supabase.storage.from('avatars').list('folder', {
|
||||
limit: 100,
|
||||
@@ -34,7 +36,7 @@ const { data, error } = await supabase.storage.from('avatars').list('folder', {
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
No description provided.
|
||||
The folder path.
|
||||
|
||||
</div>
|
||||
|
||||
@@ -54,7 +56,7 @@ No description provided.
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
No description provided.
|
||||
Search options, including `limit`, `offset`, `sortBy`, and `search`.
|
||||
|
||||
</div>
|
||||
|
||||
@@ -74,7 +76,7 @@ No description provided.
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
No description provided.
|
||||
Fetch parameters, currently only supports `signal`, which is an AbortController's signal
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@@ -8,6 +8,8 @@ custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_
|
||||
import Tabs from '@theme/Tabs'
|
||||
import TabItem from '@theme/TabItem'
|
||||
|
||||
Moves an existing file.
|
||||
|
||||
```js
|
||||
const { data, error } = await supabase.storage
|
||||
.from('avatars')
|
||||
@@ -32,7 +34,7 @@ const { data, error } = await supabase.storage
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
No description provided.
|
||||
The original file path, including the current file name. For example `folder/image.png`.
|
||||
|
||||
</div>
|
||||
|
||||
@@ -52,7 +54,7 @@ No description provided.
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
No description provided.
|
||||
The new file path, including the new file name. For example `folder/image-new.png`.
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@@ -8,6 +8,8 @@ custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_
|
||||
import Tabs from '@theme/Tabs'
|
||||
import TabItem from '@theme/TabItem'
|
||||
|
||||
Deletes files within the same bucket
|
||||
|
||||
```js
|
||||
const { data, error } = await supabase.storage
|
||||
.from('avatars')
|
||||
@@ -32,7 +34,7 @@ const { data, error } = await supabase.storage
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
No description provided.
|
||||
An array of files to be deleted, including the path and file name. For example [`folder/image.png`].
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@@ -8,6 +8,8 @@ custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_
|
||||
import Tabs from '@theme/Tabs'
|
||||
import TabItem from '@theme/TabItem'
|
||||
|
||||
Replaces an existing file at the specified path with a new one.
|
||||
|
||||
```js
|
||||
const avatarFile = event.target.files[0]
|
||||
const { data, error } = await supabase.storage
|
||||
@@ -36,7 +38,7 @@ const { data, error } = await supabase.storage
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
No description provided.
|
||||
The relative file path. Should be of the format `folder/subfolder/filename.png`. The bucket must already exist before attempting to upload.
|
||||
|
||||
</div>
|
||||
|
||||
@@ -56,7 +58,7 @@ No description provided.
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
No description provided.
|
||||
The body of the file to be stored in the bucket.
|
||||
|
||||
</div>
|
||||
|
||||
@@ -76,7 +78,10 @@ No description provided.
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
No description provided.
|
||||
HTTP headers.
|
||||
`cacheControl`: string, the `Cache-Control: max-age=<seconds>` seconds value.
|
||||
`contentType`: string, the `Content-Type` header value. Should be specified if using a `fileBody` that is neither `Blob` nor `File` nor `FormData`, otherwise will default to `text/plain;charset=UTF-8`.
|
||||
`upsert`: boolean, whether to perform an upsert.
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@@ -8,6 +8,8 @@ custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_
|
||||
import Tabs from '@theme/Tabs'
|
||||
import TabItem from '@theme/TabItem'
|
||||
|
||||
Uploads a file to an existing bucket.
|
||||
|
||||
```js
|
||||
const avatarFile = event.target.files[0]
|
||||
const { data, error } = await supabase.storage
|
||||
@@ -36,7 +38,7 @@ const { data, error } = await supabase.storage
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
No description provided.
|
||||
The relative file path. Should be of the format `folder/subfolder/filename.png`. The bucket must already exist before attempting to upload.
|
||||
|
||||
</div>
|
||||
|
||||
@@ -56,7 +58,7 @@ No description provided.
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
No description provided.
|
||||
The body of the file to be stored in the bucket.
|
||||
|
||||
</div>
|
||||
|
||||
@@ -76,7 +78,10 @@ No description provided.
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
No description provided.
|
||||
HTTP headers.
|
||||
`cacheControl`: string, the `Cache-Control: max-age=<seconds>` seconds value.
|
||||
`contentType`: string, the `Content-Type` header value. Should be specified if using a `fileBody` that is neither `Blob` nor `File` nor `FormData`, otherwise will default to `text/plain;charset=UTF-8`.
|
||||
`upsert`: boolean, whether to perform an upsert.
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@@ -8,6 +8,8 @@ custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_
|
||||
import Tabs from '@theme/Tabs'
|
||||
import TabItem from '@theme/TabItem'
|
||||
|
||||
Retrieves the details of an existing Storage bucket.
|
||||
|
||||
```js
|
||||
const { data, error } = await supabase.storage.getBucket('avatars')
|
||||
```
|
||||
@@ -30,7 +32,7 @@ const { data, error } = await supabase.storage.getBucket('avatars')
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
No description provided.
|
||||
The unique identifier of the bucket you would like to retrieve.
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@@ -8,6 +8,8 @@ custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_
|
||||
import Tabs from '@theme/Tabs'
|
||||
import TabItem from '@theme/TabItem'
|
||||
|
||||
Retrieves the details of all Storage buckets within an existing project.
|
||||
|
||||
```js
|
||||
const { data, error } = await supabase.storage.listBuckets()
|
||||
```
|
||||
|
||||
@@ -8,6 +8,8 @@ custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_
|
||||
import Tabs from '@theme/Tabs'
|
||||
import TabItem from '@theme/TabItem'
|
||||
|
||||
Updates a new Storage bucket
|
||||
|
||||
```js
|
||||
const { data, error } = await supabase.storage.updateBucket('avatars', {
|
||||
public: false,
|
||||
@@ -32,7 +34,7 @@ const { data, error } = await supabase.storage.updateBucket('avatars', {
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
No description provided.
|
||||
A unique identifier for the bucket you are updating.
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@@ -8,8 +8,6 @@ custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_
|
||||
import Tabs from '@theme/Tabs'
|
||||
import TabItem from '@theme/TabItem'
|
||||
|
||||
The event you want to listen to.
|
||||
|
||||
```js
|
||||
const mySubscription = supabase
|
||||
.from('*')
|
||||
@@ -26,7 +24,7 @@ const mySubscription = supabase
|
||||
<li className="method-list-item">
|
||||
<h4 className="method-list-item-label">
|
||||
<span className="method-list-item-label-name">
|
||||
event
|
||||
type
|
||||
</span>
|
||||
<span className="method-list-item-label-badge required">
|
||||
required
|
||||
@@ -37,7 +35,7 @@ const mySubscription = supabase
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
The event
|
||||
No description provided.
|
||||
|
||||
</div>
|
||||
|
||||
@@ -48,16 +46,16 @@ The event
|
||||
<span className="method-list-item-label-name">
|
||||
filter
|
||||
</span>
|
||||
<span className="method-list-item-label-badge false">
|
||||
optional
|
||||
<span className="method-list-item-label-badge required">
|
||||
required
|
||||
</span>
|
||||
<span className="method-list-item-validation">
|
||||
<code>Record</code>
|
||||
<code>object</code>
|
||||
</span>
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
An object that specifies what you want to listen to from the event.
|
||||
No description provided.
|
||||
|
||||
</div>
|
||||
|
||||
@@ -68,16 +66,16 @@ An object that specifies what you want to listen to from the event.
|
||||
<span className="method-list-item-label-name">
|
||||
callback
|
||||
</span>
|
||||
<span className="method-list-item-label-badge false">
|
||||
optional
|
||||
<span className="method-list-item-label-badge required">
|
||||
required
|
||||
</span>
|
||||
<span className="method-list-item-validation">
|
||||
<code>object</code>
|
||||
<code>Function</code>
|
||||
</span>
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
A callback function that is called whenever the event occurs.
|
||||
No description provided.
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
+28957
-29188
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -758,7 +758,7 @@ pages:
|
||||
title: 'invoke()'
|
||||
description: |
|
||||
Invokes a Supabase Function.
|
||||
$ref: '@supabase/functions-js.FunctionsClient.invoke'
|
||||
$ref: '@supabase/functions-js.index.FunctionsClient.invoke'
|
||||
notes: |
|
||||
- Requires an Authorization header.
|
||||
- Invoke params generally match the [Fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API) spec.
|
||||
@@ -1150,7 +1150,7 @@ pages:
|
||||
|
||||
subscribe():
|
||||
title: 'on().subscribe()'
|
||||
$ref: '@supabase/supabase-js.lib/SupabaseRealtimeChannel.SupabaseRealtimeChannel.on'
|
||||
$ref: '@supabase/realtime-js.RealtimeChannel.on'
|
||||
notes: |
|
||||
- Realtime is disabled by default for new Projects for better database performance and security. You can turn it on by [managing replication](/docs/guides/api#managing-realtime).
|
||||
- If you want to receive the "previous" data for updates and deletes, you will need to set `REPLICA IDENTITY` to `FULL`, like this: `ALTER TABLE your_table REPLICA IDENTITY FULL;`
|
||||
|
||||
Reference in new issue
Block a user