mirror of
https://github.com/supabase/supabase.git
synced 2026-10-05 09:25:06 +03:00
cleans up the spec
This commit is contained in:
1 parent
f4136d7224
commit
1c3161b2a2
2 files changed
-105
No files matched your search
@@ -1,105 +0,0 @@
|
||||
# The spec divided into 3 main sections:
|
||||
# info: general information about the library
|
||||
# types: a list of custom types
|
||||
# functions: public functions which the user can access
|
||||
|
||||
sdkspec: '001'
|
||||
|
||||
# This section outlines the general information for the library.
|
||||
info:
|
||||
id: 'supabase-js' # {string} A unique ID for this library.
|
||||
version: 'next' # {string} The current version number of the library.
|
||||
title: 'Supabase Javascript SDK' # {string} A readable name.
|
||||
language: 'javascript' # {string} The language where this library is used.
|
||||
source: 'https://github.com/supabase/supabase-js' # {string} Where developers can find the source code.
|
||||
bugs: 'https://github.com/supabase/supabase-js/issues' # {string} Where developers can file bugs.
|
||||
spec: 'https://github.com/supabase/supabase-js/spec/libspec-v001.yml' # {string} Where developers can find this spec (to link directly in the docs).
|
||||
description:
|
||||
| # {string} You can use multiline strings for descriptions and supply any markdown/text.
|
||||
An isomorphic Javascript library for GoTrue.
|
||||
|
||||
types: []
|
||||
|
||||
# This section is an array of public functions which a user might need to execute.
|
||||
functions:
|
||||
- id: 'function-client-signup' # {string} A unique identifier for this function.
|
||||
title: 'signUp()' # {string} Any function name.
|
||||
summary: 'New user signup'
|
||||
tags: ['client'] # {string[]} These tags are useful for grouping functions
|
||||
description: |
|
||||
- By default, the user will need to verify their email address before logging in. If you would like to change this, you can disable "Email Confirmations" by going to Authentication -> Settings on [app.supabase.com](https://app.supabase.com)
|
||||
- If "Email Confirmations" is turned on, a `user` is returned but `session` will be null
|
||||
- If "Email Confirmations" is turned off, both a `user` and a `session` will be returned
|
||||
- When the user confirms their email address, they will be redirected to localhost:3000 by default. To change this, you can go to Authentication -> Settings on [app.supabase.com](https://app.supabase.com)
|
||||
- If signUp() is called for an existing confirmed user:
|
||||
- If "Enable email confirmations" is enabled on the "Authentication" -> "Settings" page, an obfuscated / fake user object will be returned.
|
||||
- If "Enable email confirmations" is disabled, an error with a message "User already registered" will be returned.
|
||||
- To check if a user already exists, refer to getUser().
|
||||
usage: |
|
||||
```js
|
||||
const { user, session, error } = await gotrue.signUp({
|
||||
email: 'example@email.com',
|
||||
password: 'example-password',
|
||||
})
|
||||
```
|
||||
links: []
|
||||
attributes:
|
||||
- id: 'param-signup-options'
|
||||
title: 'signUpOptions'
|
||||
required: true
|
||||
description: 'Some description.'
|
||||
type: ['number', 'other'] # {string[]} Any values you want to appear in the docs
|
||||
- id: 'param-options'
|
||||
title: 'options'
|
||||
default: 'defaultValue' # OPTIONAL {string} a default value
|
||||
required: false
|
||||
description: 'Some description.'
|
||||
ref: 'CustomType' # {string} If a "type" is not supplied, a "ref" must be. This is a pointer to the types below.
|
||||
children:
|
||||
- id: 'param-nested'
|
||||
name: 'nestedOject'
|
||||
required: false
|
||||
description: 'Some description.'
|
||||
type: ['string']
|
||||
children:
|
||||
- id: 'param-deep' # We can nest as many as required.
|
||||
name: 'deepNesting'
|
||||
description: 'Some description.'
|
||||
required: false
|
||||
type: ['string']
|
||||
returns:
|
||||
- id: 'returns-error'
|
||||
title: 'Error'
|
||||
value: |
|
||||
```js
|
||||
Promise<{ data: null, error: PostgrestError }
|
||||
```
|
||||
ref: ['PostgrestError'] # OPTIONAL {string}. This is a pointer to the types below.
|
||||
- id: 'returns-success'
|
||||
title: 'Success'
|
||||
value: |
|
||||
```js
|
||||
Promise<{ data: PostgrestSuccess, error: null }
|
||||
```
|
||||
ref: ['PostgrestSuccess'] # OPTIONAL {string}. This is a pointer to the types below.
|
||||
examples:
|
||||
- id: 'example-signup-with-email'
|
||||
title: 'Sign up with email'
|
||||
description: |
|
||||
Use an email and password for email sign up.
|
||||
links: []
|
||||
code: |
|
||||
```js
|
||||
const { user, session, error } = await supabase.auth.signUp({
|
||||
email: 'example@email.com',
|
||||
password: 'example-password',
|
||||
})
|
||||
```
|
||||
returns:
|
||||
- id: 'example-success'
|
||||
title: 'Success'
|
||||
value: |
|
||||
```js
|
||||
Promise<{ data: any, session: any, error: null }
|
||||
```
|
||||
ref: ['AuthSuccess']
|
||||
File renamed without changes.
Reference in new issue
Block a user