Compare commits

...

156 Commits

Author SHA1 Message Date
Pilou
365b806755 Merge pull request #487 from nhost/changeset-release/main
chore: update versions
2022-04-28 23:55:00 +02:00
github-actions[bot]
74025a2d90 chore: update versions 2022-04-28 21:51:11 +00:00
Pilou
ebd6f86ea3 Merge pull request #486 from nhost/fix/fine-tune-nextjs
fix: get the refresh token in the right place in the url
2022-04-28 23:50:19 +02:00
Pierre-Louis Mercereau
7b23d33d9b fix: get the refresh token in the right place in the url 2022-04-28 22:18:48 +02:00
Pierre-Louis Mercereau
de177710f7 chore: bump correct version number, and trigger release 2022-04-28 18:39:58 +02:00
Pierre-Louis Mercereau
eebfddb48e build: bump nextjs to correct version 2022-04-28 16:52:17 +02:00
Pilou
f5df7eaa2d Merge pull request #457 from nhost/changeset-release/main
chore: update versions
2022-04-28 16:31:09 +02:00
Pierre-Louis Mercereau
0b4028b1d6 chore: remove duplicate lines in changelog 2022-04-28 15:57:20 +02:00
github-actions[bot]
f2da21026b chore: update versions 2022-04-28 13:48:50 +00:00
Pilou
a8233ea621 Merge pull request #461 from nhost/feat/get-claim
feat: add accessors for decoded access token and Hasura claims
2022-04-28 15:47:30 +02:00
Pierre-Louis Mercereau
f300d8b9f1 build: update lintstagedrc 2022-04-28 15:26:29 +02:00
Pierre-Louis Mercereau
3b625acd96 Merge branch 'main' into feat/get-claim 2022-04-28 15:24:46 +02:00
Pilou
116e23cb13 Merge pull request #459 from nhost/feat/capture-url-errors
feat: capture url errors & improved SSR / NextJs startup
2022-04-28 15:22:54 +02:00
Pierre-Louis Mercereau
954aa43e49 refactor: adjustments from review 2022-04-28 14:01:18 +02:00
Pierre-Louis Mercereau
de6f862c4c style: remove dead code and add minor piece of doc 2022-04-28 13:54:29 +02:00
Pierre-Louis Mercereau
5025333fb4 Merge branch 'main' into feat/capture-url-errors 2022-04-28 13:44:14 +02:00
Pilou
b3991ea9d9 Merge pull request #482 from nhost/docs/404
docs: custom 404 page
2022-04-28 13:42:54 +02:00
Pierre-Louis Mercereau
239db617f3 docs: clean file 2022-04-28 12:48:07 +02:00
Szilárd Dóró
6d6c8b3e2e Merge pull request #481 from nhost/fix/docgen-tags 2022-04-28 12:24:03 +02:00
Pierre-Louis Mercereau
169f163c99 docs: custom 404 page 2022-04-28 10:53:35 +02:00
Szilárd Dóró
5ddd7eda22 fixed some errors caused by undefined values 2022-04-28 10:49:03 +02:00
Szilárd Dóró
00d50f404a temporary support for link removal from TSDoc comments, renamed __tsdoc__ folder to .docgen 2022-04-28 10:21:06 +02:00
Pierre-Louis Mercereau
b52b4fca2d feat: complete NextJs 2022-04-27 22:18:03 +02:00
Pierre-Louis Mercereau
9f55f4890e chore: merge main 2022-04-27 16:44:19 +02:00
Szilárd Dóró
284890b437 Merge pull request #477 from nhost/docgen-improvements
DocGen improvements
2022-04-27 16:22:05 +02:00
Szilárd Dóró
1e3cb855f0 improved function overloads in auto-generated docs 2022-04-27 16:12:41 +02:00
Pierre-Louis Mercereau
aaf575f0af chore: remove dev code 2022-04-27 16:09:30 +02:00
Pierre-Louis Mercereau
ff3427ccdb chore: update changeset title 2022-04-27 16:08:40 +02:00
Szilárd Dóró
3834d80a0a improved the way function overloads are displayed
fixed an issue where line breaks broke the layout of parameter table fragments
2022-04-27 15:57:34 +02:00
Pierre-Louis Mercereau
8fcc3fd560 Merge branch 'main' into feat/capture-url-errors 2022-04-27 15:56:04 +02:00
Pierre-Louis Mercereau
616e320421 refactor: simplify startup 2022-04-27 15:55:04 +02:00
Pilou
ff8fdc4db4 Merge pull request #476 from nhost/contributors-readme-action-84g__a20xD
contributors readme action update
2022-04-27 15:43:27 +02:00
Szilárd Dóró
b732bc51e8 fixed an issue where multiple function signatures were not rendered properly in generated docs 2022-04-27 14:42:01 +02:00
Pierre-Louis Mercereau
8b88d6c553 refactor: augment useAuthenticationState instead of creating useAuthenticationError 2022-04-27 14:26:14 +02:00
Szilárd Dóró
af192fbb66 updated lint-staged config 2022-04-27 14:23:27 +02:00
Szilárd Dóró
b7c031d7e0 added deprecation indicator to sidebar items if applicable 2022-04-27 14:21:31 +02:00
Pierre-Louis Mercereau
05e91d93a8 fix: check if window existd 2022-04-27 14:20:52 +02:00
Pierre-Louis Mercereau
261f001a99 fix(nextjs): correct refresh method 2022-04-27 14:14:46 +02:00
Szilárd Dóró
ddb965c7cf added warning message to auto-generated markdown files 2022-04-27 14:10:17 +02:00
github-actions[bot]
ff8af4912b contrib-readme-action has updated readme 2022-04-27 11:42:13 +00:00
Pilou
948aebcf42 Merge pull request #472 from jladuval/patch-1
Docs: Update event-triggers.md with environment variable example
2022-04-27 13:41:57 +02:00
Szilárd Dóró
51a4d7a343 Merge pull request #474 from nhost/fix/docs-redirects
fix: Docs redirects
2022-04-27 13:17:41 +02:00
Johan Eliasson
d521218146 Merge pull request #475 from nhost/typo-hbuyg87y9
Typo
2022-04-27 13:08:06 +02:00
Johan Eliasson
9a1685c2eb typo 2022-04-27 12:55:43 +02:00
Szilárd Dóró
fb8f58503f updated CODEOWNERS 2022-04-27 12:31:02 +02:00
Szilárd Dóró
86409c2f18 changed React Hooks redirect 2022-04-27 12:26:36 +02:00
Szilárd Dóró
f7d8c061a0 added redirects from previously removed docs 2022-04-27 12:23:57 +02:00
Szilárd Dóró
eb59a07c3f Merge pull request #453 from nhost/feat/docgen
feat: Auto-generate documentation from TSDoc
2022-04-27 12:07:58 +02:00
Szilárd Dóró
27add80f95 added index page to JavaScript docs 2022-04-27 11:59:04 +02:00
Szilárd Dóró
cc60a845f3 fixes HasuraStorageClient examples to use code block 2022-04-27 10:53:02 +02:00
Szilárd Dóró
aeea44e4e8 fixed HasuraAuthClient examples to use code block 2022-04-27 10:51:35 +02:00
Jacob Duval
d273825cee Update event-triggers.md with environment variable example
Show how environment variables are used with the correct formatting. I had to search around a while to find the correct {{}} format.
2022-04-27 10:44:57 +02:00
Szilárd Dóró
177733f4b1 added deprecation note to parameters and parameter tables 2022-04-27 10:40:50 +02:00
Szilárd Dóró
efd33a7115 updated docs according to code changes 2022-04-27 10:04:08 +02:00
Szilárd Dóró
e4fe166992 Merge branch 'main' into feat/docgen 2022-04-27 10:02:34 +02:00
Pierre-Louis Mercereau
d9f221b625 feat: get refresh token from url in Next, and remove the refresh token from the url when possible 2022-04-27 09:55:42 +02:00
Szilárd Dóró
e0f5bf3396 fixed example in hasura-auth-client 2022-04-27 09:50:23 +02:00
Szilárd Dóró
17bd23460f added lint-staged configuration 2022-04-27 09:16:12 +02:00
Szilárd Dóró
52c30c25a9 expand Reference > JavaScript menu by default 2022-04-26 17:11:00 +02:00
Szilárd Dóró
989bc54544 added support for DocGen parallelization, improved DocGen configuration 2022-04-26 17:05:07 +02:00
Szilárd Dóró
5781cb0f9c restored accidentally removed docs pages 2022-04-26 15:51:26 +02:00
Szilárd Dóró
24f9ed4c4d fixed slugs, re-generated docs 2022-04-26 15:25:31 +02:00
Szilárd Dóró
2b447af8a7 Merge branch 'feat/docgen' of https://github.com/nhost/nhost into feat/docgen 2022-04-26 14:57:06 +02:00
Szilárd Dóró
2485c83de3 updated documentation URLs, fixed auto-generated documentation slugs 2022-04-26 14:53:26 +02:00
Pilou
707877477f Merge pull request #465 from nhost/chore/inline-react-doc
docs(react): add inline documentation
2022-04-26 14:32:15 +02:00
Pierre-Louis Mercereau
756e1af52d chore: merge 2022-04-26 14:31:35 +02:00
Pierre-Louis Mercereau
7f771e2e8f pre-merge 2022-04-26 14:29:25 +02:00
Szilárd Dóró
a737863c2b added support for flattened navigation structure on References page 2022-04-26 13:32:24 +02:00
Pierre-Louis Mercereau
ca2a61089a docs: add missing backticks 2022-04-26 12:19:53 +02:00
Szilárd Dóró
7432db0fe8 created custom sidebar mapping to support appropriate structure 2022-04-26 12:10:38 +02:00
Pierre-Louis Mercereau
9c25e65df6 docs(react): add inline documentation 2022-04-26 12:06:51 +02:00
Szilárd Dóró
e345895fd8 generated React, Next.js, Nhost JS documentation, fixed issues 2022-04-26 11:55:53 +02:00
Szilárd Dóró
cba7996dcf generated React, Next.js, Nhost JS documentation, fixed issues 2022-04-26 10:58:03 +02:00
Johan Eliasson
d7ceda6ae6 Merge pull request #464 from nhost/contributors-readme-action-yLZgG3Dxtk
contributors readme action update
2022-04-26 08:36:39 +02:00
github-actions[bot]
4e19b7309d contrib-readme-action has updated readme 2022-04-25 18:21:46 +00:00
David Barroso
de8a7d5512 Merge pull request #449 from nhost/dbarroso/update-docker-compose
update hasura-storage example
2022-04-25 20:21:32 +02:00
Pierre-Louis Mercereau
7e7aa5adc4 refactor: explain 2022-04-25 14:11:22 +02:00
Pierre-Louis Mercereau
1ed948952a refactor: remove mock credentials 2022-04-25 14:07:47 +02:00
Pilou
55b0a8f4b9 Merge pull request #458 from nhost/examples/xstate-inspector
react-apollo example: activate xstate inspector with an environment variable
2022-04-25 13:37:43 +02:00
Pierre-Louis Mercereau
1ce55c5568 feat: add aceessors for decoded access token and Hasura claims 2022-04-25 13:24:07 +02:00
Pierre-Louis Mercereau
fabd1da04c feat: new useAuthenticationError hook 2022-04-25 11:19:59 +02:00
Pierre-Louis Mercereau
53f5226d0c feat: capture hasura-auth errors from the url 2022-04-25 11:16:48 +02:00
Pilou
e339cba384 Merge pull request #450 from nhost/fix/filter-logs
Remove filtering of `useLayoutEffect` from logs
2022-04-25 11:14:05 +02:00
Pierre-Louis Mercereau
c14d12e04d docs: activate xstate inspector with an environment variable 2022-04-25 10:57:42 +02:00
Szilárd Dóró
03370da2f4 added DocGen support for React package, generated default React SDK references 2022-04-25 10:46:06 +02:00
Pilou
87d32b2639 Merge pull request #451 from nhost/chore/reprecate-bad-naming
Rename `autoLogin` to `autoSignIn`, and deprecate `autoLogin`
2022-04-25 10:13:08 +02:00
Pilou
61b5fb549c Merge pull request #456 from nhost/docs/use-display-name
docs: `useDisplayName` instead of `displayName`
2022-04-25 10:12:52 +02:00
Szilárd Dóró
28cd8dc5c5 resolved conflicts with main branch 2022-04-25 10:06:33 +02:00
Szilárd Dóró
fb93d8c1af Merge branch 'main' into feat/docgen 2022-04-25 10:05:41 +02:00
Pierre-Louis Mercereau
f4e6aea9c1 docs: fix incorrect example 2022-04-25 09:45:40 +02:00
Pierre-Louis Mercereau
d49b837abb fix: rename autoLogin to autoSignIn, and deprecate autoLogin 2022-04-25 09:09:19 +02:00
Pierre-Louis Mercereau
49545c058b fix: remove filtering of useLayoutEffect from logs 2022-04-25 08:40:34 +02:00
David Barroso
765340f7b2 update hasura-storage example 2022-04-25 08:30:39 +02:00
Pilou
2c3d9b11a6 Merge pull request #446 from nhost/changeset-release/main
chore: update versions
2022-04-22 22:33:18 +02:00
github-actions[bot]
b1678eaad3 chore: update versions 2022-04-22 20:29:10 +00:00
Pilou
f1c16dba6e Merge pull request #444 from nhost/fix/refresh-session-start
fix: fix `refreshSession`
2022-04-22 22:28:23 +02:00
Pierre-Louis Mercereau
aa1fdf6c2c fix: fix refreshSession 2022-04-22 22:18:17 +02:00
Pilou
bebf9e1f2b Merge pull request #443 from nhost/changeset-release/main
chore: update versions
2022-04-22 17:35:44 +02:00
github-actions[bot]
2413c10283 chore: update versions 2022-04-22 15:32:40 +00:00
Pilou
0f7fbdab97 Merge pull request #440 from nhost/fix/token-refresher
fix: improve reliability of the token refresher
2022-04-22 17:31:47 +02:00
Pilou
14e5fd63a6 Merge branch 'main' into fix/token-refresher 2022-04-22 17:27:11 +02:00
Pilou
2446913836 Merge pull request #439 from nhost/fix/refresh-session
fix: fix and improve `nhost.auth.refreshSession`
2022-04-22 17:22:47 +02:00
Pierre-Louis Mercereau
1f88a9f47a style: improve readability 2022-04-22 17:20:05 +02:00
Pierre-Louis Mercereau
261e37cda4 fix: fix nullable value miss 2022-04-22 16:50:30 +02:00
Pierre-Louis Mercereau
5ee395ea8e fix: ensure the session is destroyed when signout is done 2022-04-22 16:44:52 +02:00
Szilárd Dóró
e5f00394ae added tests for getNestedParametersFromParameter 2022-04-22 16:41:04 +02:00
Szilárd Dóró
dd08aef4cc added tests for helper functions, improved verbose logging 2022-04-22 15:55:08 +02:00
Szilárd Dóró
4ab85815a0 introduced support for "alias" tag, added tests for DeprecationNoteFragment and CommentTagFragment 2022-04-22 15:18:53 +02:00
Pilou
828633ffc9 Merge pull request #435 from nhost/chore/include-examples-in-monorepo
Chore/include examples in monorepo
2022-04-22 13:28:02 +02:00
Szilárd Dóró
1b0902079b changed reference paths to use root path, improved some examples of HasuraAuthClient 2022-04-22 12:55:07 +02:00
Pierre-Louis Mercereau
7b7527a5e6 fix: improve reliability of the token refresher 2022-04-22 11:32:25 +02:00
Szilárd Dóró
f719d47ed3 created command for Storage docs generation, added initial docs generated with the tool 2022-04-22 11:23:54 +02:00
Szilárd Dóró
8cc88533b1 fixed class references 2022-04-22 10:57:41 +02:00
Szilárd Dóró
71de2bd0c5 added custom styling for optional / required labels of parameters
improved prettier formatter of classes, functions and types
2022-04-21 22:50:40 +02:00
Szilárd Dóró
66d204331b improved function signature formatting, union and intersection types 2022-04-21 22:31:17 +02:00
Szilárd Dóró
ee288fbc5f added tests for ClassTemplate, improved typings of signatures 2022-04-21 21:59:26 +02:00
Pilou
620566fa4d Merge pull request #438 from nhost/changeset-release/main
chore: update versions
2022-04-21 21:58:07 +02:00
Szilárd Dóró
1a38b5dca3 fixed parameter reference generator issues, added option to wrap or unwrap values to label generator 2022-04-21 19:39:38 +02:00
Szilárd Dóró
e0bd8cf14b moved docgen to packages, created temporary scripts to execute docgen procedure 2022-04-21 18:21:36 +02:00
github-actions[bot]
4ce8b88d27 chore: update versions 2022-04-21 15:45:25 +00:00
Pilou
28d25e46de Merge pull request #436 from nhost/fix/mixed-email-password-errors
fix: invalid password and email errors on sign up
2022-04-21 17:44:35 +02:00
Pierre-Louis Mercereau
e0cfcafead fix: fix and improve nhost.auth.refreshSession 2022-04-21 16:57:55 +02:00
Pilou
12bc30daa3 Merge pull request #437 from nhost/fix/broadcast-channel-react-native
fix: avoid error when BroadcastChannell is not available
2022-04-21 16:10:49 +02:00
Pierre-Louis Mercereau
7b5f00d10e fix: avoid error when BroadcastChannell is not available 2022-04-21 16:00:12 +02:00
Pierre-Louis Mercereau
58e1485c13 fix: invalid password and email errors on sign up 2022-04-21 14:46:30 +02:00
Szilárd Dóró
1da0ff9109 fixed ESLint issues, improved error handling, improved DocGen state management 2022-04-21 14:09:44 +02:00
Johan Eliasson
a64f1c4396 typo 2022-04-21 13:54:09 +02:00
Pierre-Louis Mercereau
75a1428114 chore(examples): fix resolution error with nextjs 2022-04-21 13:42:23 +02:00
Pierre-Louis Mercereau
d82d830849 chore: update pnpm lock file 2022-04-21 13:23:13 +02:00
Pierre-Louis Mercereau
2def59fc6c chore: merge main 2022-04-21 13:21:36 +02:00
Pierre-Louis Mercereau
64ceb2c6bf docs: update examples readme 2022-04-21 12:46:05 +02:00
Pierre-Louis Mercereau
3ee007620c chore: use vite to build react-apollo-crm, and prettier examples 2022-04-21 12:40:19 +02:00
Szilárd Dóró
c08230ae95 disabled import sort command in DocGen because of the Prettier plugin 2022-04-21 12:04:43 +02:00
Szilárd Dóró
18df8921fd initial DocGen code 2022-04-21 11:44:31 +02:00
Pierre-Louis Mercereau
b9cf8172a0 chore(examples): include react-apollo and nextjs examples back in the monorepo workspace 2022-04-21 11:24:32 +02:00
Pilou
32edfb4a9f Merge pull request #432 from nhost/contributors-readme-action-GEao4TGXIq
contributors readme action update
2022-04-21 11:20:17 +02:00
Pilou
848db9b672 Merge pull request #433 from nhost/contributors-readme-action--71qTzGJKI
contributors readme action update
2022-04-21 11:19:43 +02:00
github-actions[bot]
3766921bcc contrib-readme-action has updated readme 2022-04-21 09:19:09 +00:00
Pilou
5546052b2c Merge pull request #430 from nhost/docs/update-example
Docs/update example
2022-04-21 11:18:54 +02:00
github-actions[bot]
c569b56d3d contrib-readme-action has updated readme 2022-04-21 09:18:43 +00:00
Pilou
52ffa84adb Merge pull request #431 from timpratim/patch-3
Changed the wording for better understanding
2022-04-21 11:18:26 +02:00
Pratim
b5ae438a8e Changed the wording for better understanding
Changed the wording for a better understanding of the permissions doc
2022-04-21 14:17:13 +05:30
Pierre-Louis Mercereau
fae05f7af2 docs: bump to latest version of hasura-auth 2022-04-21 10:38:15 +02:00
Pierre-Louis Mercereau
380d7fc8ce docs: bump versions 2022-04-21 10:36:53 +02:00
Pierre-Louis Mercereau
94132bbc7f docs: move allowed_redirect_urls option to the right place, and prettier files 2022-04-21 10:36:28 +02:00
Szilárd Dóró
d87a9d7c79 Merge pull request #429 from nhost/changeset-release/main
chore: update versions
2022-04-21 10:00:00 +02:00
github-actions[bot]
be7756d4a2 chore: update versions 2022-04-21 07:54:52 +00:00
Szilárd Dóró
ca5e335bff Merge pull request #425 from nhost/fix/broadcast-channel
fix: remove broadcast-channel
2022-04-21 09:53:45 +02:00
Pilou
b9ed794f2b Merge pull request #424 from nhost/docs/graphql-dependency
docs: use docusaurus tabs for npm/yarn commands, and add `graphql` dependency
2022-04-20 16:39:24 +02:00
Pierre-Louis Mercereau
042dc7d27c docs: remove duplicate text 2022-04-20 15:12:22 +02:00
Pierre-Louis Mercereau
db2df3d5b2 docs: remove useless lines 2022-04-20 15:10:57 +02:00
Pierre-Louis Mercereau
0b1cb628f2 fix: remove broadcast-channel 2022-04-20 15:08:30 +02:00
Pierre-Louis Mercereau
912d95d153 docs: add admonitions 2022-04-20 12:14:01 +02:00
Pierre-Louis Mercereau
76059f4738 docs: use docusaurus tabs for npm/yarn commands, and add graphql dependency 2022-04-20 12:06:21 +02:00
Pilou
011572f3ef Merge pull request #423 from nhost/docs/auth-host
docs: notify AUTH_HOST won't be available after hasura-auth `v0.6.0`
2022-04-20 09:22:44 +02:00
Pierre-Louis Mercereau
b727b354dd docs: notify AUTH_HOST won't be available after hasura-auth v0.6.0 2022-04-20 08:37:32 +02:00
458 changed files with 23197 additions and 23473 deletions

View File

@@ -18,5 +18,7 @@ module.exports = {
useTabs: false
}
}
]
],
importOrderSeparation: true,
importOrderSortSpecifiers: true
}

1
.github/CODEOWNERS vendored
View File

@@ -2,6 +2,7 @@
# https://help.github.com/en/articles/about-code-owners
/packages @plmercereau
/packages/docgen @szilarddoro
/.github/workflows @plmercereau
/docs/ @guicurcio
/examples/ @plmercereau @guicurcio @FuzzyReason

7
.gitignore vendored
View File

@@ -15,7 +15,6 @@ logs/
/.vscode/
.eslintcache
.yarnclean
.husky
# Directories
coverage/
@@ -50,4 +49,8 @@ todo.md
.netlify
.monorepo-example
.next
.next
# TypeDoc output
.docgen

1
.husky/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
_

4
.husky/pre-commit Executable file
View File

@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
npx lint-staged

6
.lintstagedrc.json Normal file
View File

@@ -0,0 +1,6 @@
{
"packages/(docgen|hasura-auth-js|hasura-storage-js|nextjs|nhost-js|react|core)/src/**/*.{js,ts,jsx,tsx}": [
"pnpm docgen",
"git add docs"
]
}

View File

@@ -20,7 +20,7 @@
<hr />
</div>
**Nhost is a open-source GraphQL backend,** built with the following things in mind:
**Nhost is an open-source GraphQL backend,** built with the following things in mind:
- Open-Source
- Developer Productivity
@@ -98,7 +98,7 @@ Nhost is frontend agnostic, which means Nhost works with all frontend frameworks
Nhost libraries and tools
- [JavaScript/TypeScript SDK](https://docs.nhost.io/reference/sdk)
- [JavaScript/TypeScript SDK](https://docs.nhost.io/reference/javascript)
- [Dart and Flutter SDK](https://github.com/nhost/nhost-dart)
- [Nhost CLI](https://docs.nhost.io/reference/cli)
- [Nhost React](https://docs.nhost.io/reference/react)
@@ -213,6 +213,13 @@ Here are some ways of contributing to making Nhost better:
</a>
</td></tr>
<tr>
<td align="center">
<a href="https://github.com/dbarrosop">
<img src="https://avatars.githubusercontent.com/u/6246622?v=4" width="100;" alt="dbarrosop"/>
<br />
<sub><b>David Barroso</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/hajek-raven">
<img src="https://avatars.githubusercontent.com/u/7288737?v=4" width="100;" alt="hajek-raven"/>
@@ -234,13 +241,21 @@ Here are some ways of contributing to making Nhost better:
<sub><b>Mustafa Hanif</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/timpratim">
<img src="https://avatars.githubusercontent.com/u/32492961?v=4" width="100;" alt="timpratim"/>
<br />
<sub><b>Pratim</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/Savinvadim1312">
<img src="https://avatars.githubusercontent.com/u/16936043?v=4" width="100;" alt="Savinvadim1312"/>
<br />
<sub><b>Savin Vadim</b></sub>
</a>
</td>
</td></tr>
<tr>
<td align="center">
<a href="https://github.com/ahmic">
<img src="https://avatars.githubusercontent.com/u/13452362?v=4" width="100;" alt="ahmic"/>
@@ -254,8 +269,7 @@ Here are some ways of contributing to making Nhost better:
<br />
<sub><b>Anders Kjær Damgaard</b></sub>
</a>
</td></tr>
<tr>
</td>
<td align="center">
<a href="https://github.com/rustyb">
<img src="https://avatars.githubusercontent.com/u/53086?v=4" width="100;" alt="rustyb"/>
@@ -283,7 +297,8 @@ Here are some ways of contributing to making Nhost better:
<br />
<sub><b>Helio Alves</b></sub>
</a>
</td>
</td></tr>
<tr>
<td align="center">
<a href="https://github.com/nkhdo">
<img src="https://avatars.githubusercontent.com/u/26102306?v=4" width="100;" alt="nkhdo"/>
@@ -291,20 +306,19 @@ Here are some ways of contributing to making Nhost better:
<sub><b>Hoang Do</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/jladuval">
<img src="https://avatars.githubusercontent.com/u/1935359?v=4" width="100;" alt="jladuval"/>
<br />
<sub><b>Jacob Duval</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/ghoshnirmalya">
<img src="https://avatars.githubusercontent.com/u/6391763?v=4" width="100;" alt="ghoshnirmalya"/>
<br />
<sub><b>Nirmalya Ghosh</b></sub>
</a>
</td></tr>
<tr>
<td align="center">
<a href="https://github.com/timpratim">
<img src="https://avatars.githubusercontent.com/u/32492961?v=4" width="100;" alt="timpratim"/>
<br />
<sub><b>Pratim</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/quentin-decre">

View File

@@ -2,6 +2,9 @@
title: 'Metadata and Serverless Functions'
---
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
In the previous section, we only created a new table; `customers`. Using the CLI you can also do changes to other parts of your backend.
There are three things the CLI and the GitHub integration track and applies to production:
@@ -73,20 +76,25 @@ Serverless functions are placed in the `functions/` folder of your repository. E
Before we create our serverless function we'll install `express`, which is a requirement for serverless functions to work.
<Tabs>
<TabItem value="npm" label="npm" default>
```bash
npm install express
# or with yarn
yarn add express
npm install -d @types/node @types/express
```
We'll use TypeScript so we'll install two type definitions too:
</TabItem>
<TabItem value="yarn" label="Yarn">
```bash
npm install -d @types/node @types/express
# or with yarn
yarn add express
yarn add -D @types/node @types/express
```
</TabItem>
</Tabs>
Then we'll create a file `functions/time.ts`
In the file `time.ts` we'll add the following code to create our serverless function:

View File

@@ -2,6 +2,9 @@
title: 'JavaScript client'
---
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
In the previous section, you used the Hasura Console to fetch a list of todos. Now, you will write a small JavaScript client to interact and retrieve todos from your Nhost app.
### Frontend frameworks
@@ -14,40 +17,36 @@ In this guide, we'll keep the example simple. We're not using a frontend framewo
## Setup
> Make sure you have [Node.js](https://nodejs.org) and [npm](https://docs.npmjs.com/getting-started) installed.
:::info
Create a new folder called `nhost-todos`, and initialize a new JavaScript app there:
Make sure you have [Node.js](https://nodejs.org) and [npm](https://docs.npmjs.com/getting-started) or [Yarn](https://classic.yarnpkg.com/lang/en/docs/install) installed.
Using npm package manager
:::
Create a new folder called `nhost-todos`, initialize a new JavaScript app there, and install the Nhost JavaScript SDK:
<Tabs>
<TabItem value="npm" label="npm" default>
```bash
npm init -y
yarn add @nhost/nhost-js graphql
```
or
Using Yarn package manager
</TabItem>
<TabItem value="yarn" label="Yarn">
```bash
yarn init -y
npm install @nhost/nhost-js graphql
```
> You might have to edit the `package.json` file and add/change the `type` object to `module` (`"type": "module"`).
</TabItem>
</Tabs>
Install Nhost JavaScript SDK:
Using npm package manager
```bash
npm install @nhost/nhost-js
```
or
Using Yarn package manager
```bash
yarn add @nhost/nhost-js
```
:::caution attention
You might have to edit the `package.json` file and add/change the `type` object to `module` (`"type": "module"`).
:::
---

View File

@@ -2,7 +2,7 @@
title: 'Set permissions'
---
In the previous section, you could fetch the todos because the **admin** role is enabled by default when using Hasura Console. When building your applications, you want to define permissions using **roles** that your users can assume when making requests.
While using the Hasura Console, you could fetch the todos because the **admin** role is enabled by default but when building your applications with a client, you want to define permissions using **roles** that your users can assume when making requests.
Hasura supports role-based access control. You create rules for each role, table, and operation (select, insert, update and delete) that can check dynamic session variables, like user ID.

View File

@@ -9,7 +9,7 @@ Nhost provides a ready-to-use authentication service, integrated with Nhost Java
## Getting Started
Sign up a user with the [Nhost JavaScript SDK](/reference/sdk):
Sign up a user with the [Nhost JavaScript SDK](/reference/javascript):
```js
import { NhostClient } from '@nhost/nhost-js';
@@ -48,7 +48,7 @@ query {
Nhost authentication uses two tokens: Access tokens and refresh tokens.
[Nhost JavaScript SDK](/reference/sdk) automatically handles access and refresh tokens.
[Nhost JavaScript SDK](/reference/javascript) automatically handles access and refresh tokens.
### Access tokens

View File

@@ -58,7 +58,7 @@ To make sure we can fetch all user data (email, profile picture and name). For t
## Sign In users in your app
Use the [Nhost JavaScript client](/reference/sdk) to sign in users in your app:
Use the [Nhost JavaScript client](/reference/javascript) to sign in users in your app:
```js
nhost.auth.signIn({

View File

@@ -43,7 +43,7 @@ Follow this guide to sign in users with GitHub with your Nhost App.
## Sign In users in your app
Use the [Nhost JavaScript client](/reference/sdk) to sign in users in your app:
Use the [Nhost JavaScript client](/reference/javascript) to sign in users in your app:
```js
nhost.auth.signIn({

View File

@@ -23,7 +23,7 @@ You need to set client ID and client secret for each provider that you want to e
## Implementing sign-in experience
Use the [Nhost JavaScript SDK](/reference/sdk) and the `signIn()` method to implement social sign-in in your app,
Use the [Nhost JavaScript SDK](/reference/javascript) and the `signIn()` method to implement social sign-in in your app,
Here's an example of how to implement sign-in with GitHub:

View File

@@ -50,7 +50,7 @@ Follow this guide to sign in users with LinkedIn with your Nhost App.
## Sign In users in your app
Use the [Nhost JavaScript client](/reference/sdk) to sign in users in your app:
Use the [Nhost JavaScript client](/reference/javascript) to sign in users in your app:
```js
nhost.auth.signIn({

View File

@@ -43,7 +43,7 @@ Follow this guide to sign in users with Spotify with your Nhost App.
## Sign In users in your app
Use the [Nhost JavaScript client](/reference/sdk) to sign in users in your app:
Use the [Nhost JavaScript client](/reference/javascript) to sign in users in your app:
```js
nhost.auth.signIn({

View File

@@ -20,7 +20,7 @@ To interact with the GraphQL API it's recommended to use a GraphQL client:
- [React Query](https://react-query.tanstack.com/graphql)
- [SWR](https://swr.vercel.app/docs/data-fetching#graphql)
It's also possible to use the built-in [GraphQL client](/reference/sdk/graphql) in the Nhost JavaScript client.
It's also possible to use the built-in [GraphQL client](/reference/javascript/nhost-js/graphql) in the Nhost JavaScript client.
---

View File

@@ -3,6 +3,9 @@ title: 'Nhost CLI'
sidebar_position: 3
---
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
Nhost CLI lets you run Nhost's development environment locally on macOS, Linux and Windows.
---
@@ -28,10 +31,23 @@ To run serverless functions locally, you must have the appropriate runtimes inst
For Node.js, you will also need to have [express](https://www.npmjs.com/package/express) installed in your repository:
<Tabs>
<TabItem value="npm" label="npm" default>
```bash
npm install --save-dev express @types/express
```
</TabItem>
<TabItem value="yarn" label="Yarn">
```bash
yarn add -D express @types/express
```
</TabItem>
</Tabs>
[Read more about runtimes](/platform/serverless-functions)
---

View File

@@ -29,6 +29,10 @@ https://[app-subdomain].nhost.run/v1/functions/my-endpoint
The environment variable `NHOST_BACKEND_URL` will have the correct value.
```bash
{{NHOST_BACKEND_URL}}/v1/functions/my-endpoint
```
---
## Security

View File

@@ -0,0 +1,3 @@
{
"label": "Auth"
}

View File

@@ -0,0 +1,29 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: signUp()
sidebar_label: signUp()
slug: /reference/javascript/auth/sign-up
description: Use `signUp` to sign up users using email an password.
---
# `signUp()`
Use `signUp` to sign up users using email an password.
```ts
auth.signIn({ email, password }) // email password
```
## Parameters
---
**<span className="parameter-name">params</span>** <span className="optional-status">required</span> [`SignUpEmailPasswordParams`](/reference/docgen/javascript/auth/types/sign-up-email-password-params)
| Property | Type | Required | Notes |
| :------------------------------------------------------------------------------------------ | :-------------- | :------: | :---- |
| <span className="parameter-name"><span className="light-grey">params.</span>password</span> | `string` | ✔️ | |
| <span className="parameter-name"><span className="light-grey">params.</span>email</span> | `string` | ✔️ | |
| <span className="parameter-name"><span className="light-grey">params.</span>options</span> | `SignUpOptions` | | |
---

View File

@@ -0,0 +1,53 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: signIn()
sidebar_label: signIn()
slug: /reference/javascript/auth/sign-in
description: Use `signIn` to sign in users using email and password, passwordless (email or sms) or an external provider. `signIn` can be used in various ways depending on the parameters.
---
# `signIn()`
Use `signIn` to sign in users using email and password, passwordless
(email or sms) or an external provider.
`signIn` can be used in various ways depending on the parameters.
```ts
signIn({ email, password })
```
## Parameters
---
**<span className="parameter-name">params</span>** <span className="optional-status">required</span> [`SignInParams`](/reference/docgen/javascript/auth/types/sign-in-params)
---
## Examples
### Sign in with email and password
```ts
signIn({ email, password })
```
### Sign in with an external provider (e.g: Google or Facebook)
```ts
signIn({ provider })
```
### Passwordless sign in with email (magic link)
```ts
signIn({ email }) // [step 1/2] Passwordless sign in with Email (Magic Link)
signIn({ email, otp }) // [step 2/2] Finish passwordless sign in with email (OTP)
```
### Passwordless sign in with SMS
```ts
signIn({ phoneNumber }) // [step 1/2] Passwordless sign in with SMS
signIn({ phoneNumber, otp }) // [step 2/2] Finish passwordless sign in with SMS (OTP)
```

View File

@@ -0,0 +1,23 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: signOut()
sidebar_label: signOut()
slug: /reference/javascript/auth/sign-out
description: Use `signOut` to sign out a user
---
# `signOut()`
Use `signOut` to sign out a user
```ts
signOut()
```
## Parameters
---
**<span className="parameter-name">params</span>** <span className="optional-status">optional</span> `{ all: boolean }`
---

View File

@@ -0,0 +1,28 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: resetPassword()
sidebar_label: resetPassword()
slug: /reference/javascript/auth/reset-password
description: Use `resetPassword` to reset a user's password.
---
# `resetPassword()`
Use `resetPassword` to reset a user's password.
```ts
auth.resetPassword({ email })
```
## Parameters
---
**<span className="parameter-name">\_\_namedParameters</span>** <span className="optional-status">required</span> [`ResetPasswordParams`](/reference/docgen/javascript/auth/types/reset-password-params)
| Property | Type | Required | Notes |
| :------------------------------------------------------------------------------------------------------ | :--------------- | :------: | :---- |
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>email</span> | `string` | ✔️ | |
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>options</span> | `RedirectOption` | | |
---

View File

@@ -0,0 +1,27 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: changePassword()
sidebar_label: changePassword()
slug: /reference/javascript/auth/change-password
description: Use `changePassword` to change a user's password.
---
# `changePassword()`
Use `changePassword` to change a user's password.
```ts
auth.changePassword({ newPassword })
```
## Parameters
---
**<span className="parameter-name">params</span>** <span className="optional-status">required</span> [`ChangePasswordParams`](/reference/docgen/javascript/auth/types/change-password-params)
| Property | Type | Required | Notes |
| :--------------------------------------------------------------------------------------------- | :------- | :------: | :---- |
| <span className="parameter-name"><span className="light-grey">params.</span>newPassword</span> | `string` | ✔️ | |
---

View File

@@ -0,0 +1,29 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: sendVerificationEmail()
sidebar_label: sendVerificationEmail()
slug: /reference/javascript/auth/send-verification-email
description: Use `sendVerificationEmail` to send a verification email to the specified email.
---
# `sendVerificationEmail()`
Use `sendVerificationEmail` to send a verification email
to the specified email.
```ts
auth.sendVerificationEmail({ email })
```
## Parameters
---
**<span className="parameter-name">params</span>** <span className="optional-status">required</span> [`SendVerificationEmailParams`](/reference/docgen/javascript/auth/types/send-verification-email-params)
| Property | Type | Required | Notes |
| :----------------------------------------------------------------------------------------- | :--------------- | :------: | :---- |
| <span className="parameter-name"><span className="light-grey">params.</span>email</span> | `string` | ✔️ | |
| <span className="parameter-name"><span className="light-grey">params.</span>options</span> | `RedirectOption` | | |
---

View File

@@ -0,0 +1,28 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: changeEmail()
sidebar_label: changeEmail()
slug: /reference/javascript/auth/change-email
description: Use `changeEmail` to change a user's email
---
# `changeEmail()`
Use `changeEmail` to change a user's email
```ts
auth.changeEmail({ newEmail })
```
## Parameters
---
**<span className="parameter-name">\_\_namedParameters</span>** <span className="optional-status">required</span> [`ChangeEmailParams`](/reference/docgen/javascript/auth/types/change-email-params)
| Property | Type | Required | Notes |
| :------------------------------------------------------------------------------------------------------- | :--------------- | :------: | :---- |
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>newEmail</span> | `string` | ✔️ | |
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>options</span> | `RedirectOption` | | |
---

View File

@@ -0,0 +1,32 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: deanonymize()
sidebar_label: deanonymize()
slug: /reference/javascript/auth/deanonymize
description: Use `deanonymize` to deanonymize a user
---
# `deanonymize()`
Use `deanonymize` to deanonymize a user
```ts
auth.deanonymize({ signInMethod: 'email-password', email })
```
## Parameters
---
**<span className="parameter-name">params</span>** <span className="optional-status">required</span> [`DeanonymizeParams`](/reference/docgen/javascript/auth/types/deanonymize-params)
| Property | Type | Required | Notes |
| :---------------------------------------------------------------------------------------------- | :------------------------------------- | :------: | :---- |
| <span className="parameter-name"><span className="light-grey">params.</span>email</span> | `string` | ✔️ | |
| <span className="parameter-name"><span className="light-grey">params.</span>signInMethod</span> | `"email-password"` \| `"passwordless"` | ✔️ | |
| <span className="parameter-name"><span className="light-grey">params.</span>allowedRoles</span> | `Array<string>` | | |
| <span className="parameter-name"><span className="light-grey">params.</span>defaultRole</span> | `string` | | |
| <span className="parameter-name"><span className="light-grey">params.</span>connection</span> | `"email"` \| `"sms"` | | |
| <span className="parameter-name"><span className="light-grey">params.</span>password</span> | `string` | | |
---

View File

@@ -0,0 +1,24 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: onTokenChanged()
sidebar_label: onTokenChanged()
slug: /reference/javascript/auth/on-token-changed
description: Use `onTokenChanged` to add a custom function that will trigger whenever the access and refresh token is changed.
---
# `onTokenChanged()`
Use `onTokenChanged` to add a custom function that will trigger whenever
the access and refresh token is changed.
```ts
auth.onTokenChanged(() => console.log('access token changed'))
```
## Parameters
---
**<span className="parameter-name">fn</span>** <span className="optional-status">required</span> [`OnTokenChangedFunction`](/reference/docgen/javascript/auth/types/on-token-changed-function)
---

View File

@@ -0,0 +1,29 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: onAuthStateChanged()
sidebar_label: onAuthStateChanged()
slug: /reference/javascript/auth/on-auth-state-changed
description: Use `onAuthStateChanged` to add a custom function that will trigger whenever the state of the user changed. Ex from signed in to signed out or vice versa.
---
# `onAuthStateChanged()`
Use `onAuthStateChanged` to add a custom function that will trigger
whenever the state of the user changed. Ex from signed in to signed out or
vice versa.
```ts
auth.onAuthStateChanged((event, session) => {
console.log(
`Auth state changed. State is now ${event} with session: ${session}`
)
})
```
## Parameters
---
**<span className="parameter-name">fn</span>** <span className="optional-status">required</span> [`AuthChangedFunction`](/reference/docgen/javascript/auth/types/auth-changed-function)
---

View File

@@ -0,0 +1,19 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: isAuthenticated()
sidebar_label: isAuthenticated()
slug: /reference/javascript/auth/is-authenticated
description: Use `isAuthenticated` to check if the user is authenticated or not.
---
# `isAuthenticated()`
Use `isAuthenticated` to check if the user is authenticated or not.
```ts
const = auth.isAuthenticated();
if (authenticated) {
console.log('User is authenticated');
}
```

View File

@@ -0,0 +1,19 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: isAuthenticatedAsync()
sidebar_label: isAuthenticatedAsync()
slug: /reference/javascript/auth/is-authenticated-async
description: Use `isAuthenticatedAsync` to wait and check if the user is authenticated or not.
---
# `isAuthenticatedAsync()`
Use `isAuthenticatedAsync` to wait and check if the user is authenticated or not.
```ts
const isAuthenticated = awiat auth.isAuthenticatedAsync();
if (isAuthenticated) {
console.log('User is authenticated');
}
```

View File

@@ -0,0 +1,23 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: getAuthenticationStatus()
sidebar_label: getAuthenticationStatus()
slug: /reference/javascript/auth/get-authentication-status
description: Use `getAuthenticationStatus` to get the authentication status of the user.
---
# `getAuthenticationStatus()`
Use `getAuthenticationStatus` to get the authentication status of the user.
```ts
const { isAuthenticated, isLoading } = auth.getAuthenticationStatus()
if (isLoading) {
console.log('Loading...')
}
if (isAuthenticated) {
console.log('User is authenticated')
}
```

View File

@@ -0,0 +1,14 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: getJWTToken()
sidebar_label: getJWTToken()
slug: /reference/javascript/auth/get-jwt-token
sidebar_class_name: deprecated
description: No description provided.
---
# `getJWTToken()`
:::caution Deprecated
Use `getAccessToken()` instead.
:::

View File

@@ -0,0 +1,15 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: getAccessToken()
sidebar_label: getAccessToken()
slug: /reference/javascript/auth/get-access-token
description: Use `getAccessToken` to get the logged in user's access token.
---
# `getAccessToken()`
Use `getAccessToken` to get the logged in user's access token.
```ts
const accessToken = auth.getAccessToken()
```

View File

@@ -0,0 +1,15 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: getDecodedAccessToken()
sidebar_label: getDecodedAccessToken()
slug: /reference/javascript/auth/get-decoded-access-token
description: Decode the current decoded access token (JWT), or return `null` if the user is not authenticated (no token)
---
# `getDecodedAccessToken()`
Decode the current decoded access token (JWT), or return `null` if the user is not authenticated (no token)
**`@see`**
{@link https://hasura.io/docs/latest/graphql/core/auth/authentication/jwt/|Hasura documentation}

View File

@@ -0,0 +1,15 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: getHasuraClaims()
sidebar_label: getHasuraClaims()
slug: /reference/javascript/auth/get-hasura-claims
description: Decode the Hasura claims from the current access token (JWT) located in the `https://hasura.io/jwt/claims` namespace, or return `null` if the user is not authenticated (no token)
---
# `getHasuraClaims()`
Decode the Hasura claims from the current access token (JWT) located in the `https://hasura.io/jwt/claims` namespace, or return `null` if the user is not authenticated (no token)
**`@see`**
{@link https://hasura.io/docs/latest/graphql/core/auth/authentication/jwt/|Hasura documentation}

View File

@@ -0,0 +1,26 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: getHasuraClaim()
sidebar_label: getHasuraClaim()
slug: /reference/javascript/auth/get-hasura-claim
description: Get the value of a given Hasura claim in the current access token (JWT). Returns null if the user is not authenticated, or if the claim is not in the token. Return `null` if the user is not authenticated (no token)
---
# `getHasuraClaim()`
Get the value of a given Hasura claim in the current access token (JWT). Returns null if the user is not authenticated, or if the claim is not in the token.
Return `null` if the user is not authenticated (no token)
**`@see`**
{@link https://hasura.io/docs/latest/graphql/core/auth/authentication/jwt/|Hasura documentation}
## Parameters
---
**<span className="parameter-name">name</span>** <span className="optional-status">required</span> `string`
name of the variable. Automatically adds the `x-hasura-` prefix if it is missing
---

View File

@@ -0,0 +1,25 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: refreshSession()
sidebar_label: refreshSession()
slug: /reference/javascript/auth/refresh-session
description: Use `refreshSession()` to refresh the current session or refresh the session with an provided `refreshToken`.
---
# `refreshSession()`
Use `refreshSession()` to refresh the current session or refresh the
session with an provided `refreshToken`.
```ts
refreshToken()
refreshToken(refreshToken)
```
## Parameters
---
**<span className="parameter-name">refreshToken</span>** <span className="optional-status">optional</span> `string`
---

View File

@@ -0,0 +1,15 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: getSession()
sidebar_label: getSession()
slug: /reference/javascript/auth/get-session
description: Use `getSession()` to get the current session.
---
# `getSession()`
Use `getSession()` to get the current session.
```ts
const session = getSession()
```

View File

@@ -0,0 +1,15 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: getUser()
sidebar_label: getUser()
slug: /reference/javascript/auth/get-user
description: Use `getUser()` to get the current user.
---
# `getUser()`
Use `getUser()` to get the current user.
```ts
const user = getUser()
```

View File

@@ -0,0 +1,31 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: HasuraAuthClient
sidebar_label: Auth
description: No description provided.
slug: /reference/javascript/auth
---
# `HasuraAuthClient`
## Parameters
---
**<span className="parameter-name">\_\_namedParameters</span>** <span className="optional-status">required</span> [`NhostAuthConstructorParams`](/reference/docgen/javascript/auth/types/nhost-auth-constructor-params)
| Property | Type | Required | Notes |
| :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :--------------------------------------------------------------------------------- | :------: | :---------------------------------------------------------------------------------------------------------------- |
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>url</span> | `string` | ✔️ | |
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>Client</span> | `AuthClient` | | |
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>start</span> | `boolean` | | |
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>autoSignIn</span> | `boolean` | | When set to true, will parse the url on startup to check if it contains a refresh token to start the session with |
| <span className="parameter-name deprecated"><span className="light-grey">\_\_namedParameters.</span>autoLogin</span> <span className="deprecation-sign" title="use autoSignIn instead">⚠️</span> | `boolean` | | |
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>autoRefreshToken</span> | `boolean` | | When set to true, will automatically refresh token before it expires |
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>clientStorageSetter</span> | [`StorageSetter`](/reference/docgen/javascript/auth/types/storage-setter) | | Define a way to set information about the refresh token and its exipration date |
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>clientStorageGetter</span> | [`StorageGetter`](/reference/docgen/javascript/auth/types/storage-getter) | | Define a way to get information about the refresh token and its exipration date |
| <span className="parameter-name deprecated"><span className="light-grey">\_\_namedParameters.</span>clientStorageType</span> <span className="deprecation-sign" title="Use clientStorageGetter and clientStorageSetter options instead">⚠️</span> | [`ClientStorageType`](/reference/docgen/javascript/auth/types/client-storage-type) | | |
| <span className="parameter-name deprecated"><span className="light-grey">\_\_namedParameters.</span>clientStorage</span> <span className="deprecation-sign" title="Use clientStorageGetter and clientStorageSetter options instead">⚠️</span> | [`ClientStorage`](/reference/docgen/javascript/auth/types/client-storage) | | |
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>refreshIntervalTime</span> | `number` | | Time interval until token refreshes, in seconds |
---

View File

@@ -0,0 +1,9 @@
{
"label": "Types",
"position": 1,
"className": "hidden",
"link": {
"type": "generated-index",
"slug": "/reference/docgen/javascript/auth/types"
}
}

View File

@@ -0,0 +1,17 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: ApiChangeEmailResponse
sidebar_label: ApiChangeEmailResponse
description: No description provided.
displayed_sidebar: referenceSidebar
---
# `ApiChangeEmailResponse`
## Parameters
---
**<span className="parameter-name">error</span>** <span className="optional-status">required</span> `null` | [`ApiError`](/reference/docgen/javascript/auth/types/api-error)
---

View File

@@ -0,0 +1,17 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: ApiChangePasswordResponse
sidebar_label: ApiChangePasswordResponse
description: No description provided.
displayed_sidebar: referenceSidebar
---
# `ApiChangePasswordResponse`
## Parameters
---
**<span className="parameter-name">error</span>** <span className="optional-status">required</span> `null` | [`ApiError`](/reference/docgen/javascript/auth/types/api-error)
---

View File

@@ -0,0 +1,17 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: ApiDeanonymizeResponse
sidebar_label: ApiDeanonymizeResponse
description: No description provided.
displayed_sidebar: referenceSidebar
---
# `ApiDeanonymizeResponse`
## Parameters
---
**<span className="parameter-name">error</span>** <span className="optional-status">required</span> `null` | [`ApiError`](/reference/docgen/javascript/auth/types/api-error)
---

View File

@@ -0,0 +1,21 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: ApiError
sidebar_label: ApiError
description: No description provided.
displayed_sidebar: referenceSidebar
---
# `ApiError`
## Parameters
---
**<span className="parameter-name">message</span>** <span className="optional-status">required</span> `string`
---
**<span className="parameter-name">status</span>** <span className="optional-status">required</span> `number`
---

View File

@@ -0,0 +1,15 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: ApiRefreshTokenResponse
sidebar_label: ApiRefreshTokenResponse
description: No description provided.
displayed_sidebar: referenceSidebar
---
# `ApiRefreshTokenResponse`
```ts
type ApiRefreshTokenResponse =
| { session: null; error: ApiError }
| { session: Session; error: null }
```

View File

@@ -0,0 +1,17 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: ApiResetPasswordResponse
sidebar_label: ApiResetPasswordResponse
description: No description provided.
displayed_sidebar: referenceSidebar
---
# `ApiResetPasswordResponse`
## Parameters
---
**<span className="parameter-name">error</span>** <span className="optional-status">required</span> `null` | [`ApiError`](/reference/docgen/javascript/auth/types/api-error)
---

View File

@@ -0,0 +1,17 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: ApiSendVerificationEmailResponse
sidebar_label: ApiSendVerificationEmailResponse
description: No description provided.
displayed_sidebar: referenceSidebar
---
# `ApiSendVerificationEmailResponse`
## Parameters
---
**<span className="parameter-name">error</span>** <span className="optional-status">required</span> `null` | [`ApiError`](/reference/docgen/javascript/auth/types/api-error)
---

View File

@@ -0,0 +1,28 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: ApiSignInData
sidebar_label: ApiSignInData
description: No description provided.
displayed_sidebar: referenceSidebar
---
# `ApiSignInData`
## Parameters
---
**<span className="parameter-name">session</span>** <span className="optional-status">required</span> [`Session`](/reference/docgen/javascript/auth/types/session)
| Property | Type | Required | Notes |
| :------------------------------------------------------------------------------------------------------- | :--------------------------------------------------------------- | :------: | :---- |
| <span className="parameter-name"><span className="light-grey">session.</span>user</span> | `null` \| [`User`](/reference/docgen/javascript/auth/types/user) | ✔️ | |
| <span className="parameter-name"><span className="light-grey">session.</span>refreshToken</span> | `string` | ✔️ | |
| <span className="parameter-name"><span className="light-grey">session.</span>accessTokenExpiresIn</span> | `number` | ✔️ | |
| <span className="parameter-name"><span className="light-grey">session.</span>accessToken</span> | `string` | ✔️ | |
---
**<span className="parameter-name">mfa</span>** <span className="optional-status">required</span> `null` | [`Mfa`](/reference/docgen/javascript/auth/types/mfa)
---

View File

@@ -0,0 +1,15 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: ApiSignInResponse
sidebar_label: ApiSignInResponse
description: No description provided.
displayed_sidebar: referenceSidebar
---
# `ApiSignInResponse`
```ts
type ApiSignInResponse =
| { data: ApiSignInData; error: null }
| { data: null; error: ApiError }
```

View File

@@ -0,0 +1,17 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: ApiSignOutResponse
sidebar_label: ApiSignOutResponse
description: No description provided.
displayed_sidebar: referenceSidebar
---
# `ApiSignOutResponse`
## Parameters
---
**<span className="parameter-name">error</span>** <span className="optional-status">required</span> `null` | [`ApiError`](/reference/docgen/javascript/auth/types/api-error)
---

View File

@@ -0,0 +1,15 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: ApiSignUpEmailPasswordResponse
sidebar_label: ApiSignUpEmailPasswordResponse
description: No description provided.
displayed_sidebar: referenceSidebar
---
# `ApiSignUpEmailPasswordResponse`
```ts
type ApiSignUpEmailPasswordResponse =
| { session: null; error: ApiError }
| { session: Session; error: null }
```

View File

@@ -0,0 +1,13 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: AuthChangeEvent
sidebar_label: AuthChangeEvent
description: No description provided.
displayed_sidebar: referenceSidebar
---
# `AuthChangeEvent`
```ts
type AuthChangeEvent = 'SIGNED_IN' | 'SIGNED_OUT'
```

View File

@@ -0,0 +1,16 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: AuthChangedFunction
sidebar_label: AuthChangedFunction
description: No description provided.
displayed_sidebar: referenceSidebar
---
# `AuthChangedFunction`
```ts
type AuthChangedFunction = () => (
event: AuthChangeEvent,
session: Session | null
) => void
```

View File

@@ -0,0 +1,21 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: ChangeEmailParams
sidebar_label: ChangeEmailParams
description: No description provided.
displayed_sidebar: referenceSidebar
---
# `ChangeEmailParams`
## Parameters
---
**<span className="parameter-name">newEmail</span>** <span className="optional-status">required</span> `string`
---
**<span className="parameter-name">options</span>** <span className="optional-status">optional</span> `RedirectOption`
---

View File

@@ -0,0 +1,17 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: ChangePasswordParams
sidebar_label: ChangePasswordParams
description: No description provided.
displayed_sidebar: referenceSidebar
---
# `ChangePasswordParams`
## Parameters
---
**<span className="parameter-name">newPassword</span>** <span className="optional-status">required</span> `string`
---

View File

@@ -0,0 +1,19 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: ClientStorageType
sidebar_label: ClientStorageType
description: No description provided.
displayed_sidebar: referenceSidebar
---
# `ClientStorageType`
```ts
type ClientStorageType =
| 'capacitor'
| 'custom'
| 'expo-secure-storage'
| 'localStorage'
| 'react-native'
| 'web'
```

View File

@@ -0,0 +1,49 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: ClientStorage
sidebar_label: ClientStorage
description: No description provided.
displayed_sidebar: referenceSidebar
---
# `ClientStorage`
## Parameters
---
**<span className="parameter-name">deleteItemAsync</span>** <span className="optional-status">optional</span> `(key: string) => void`
---
**<span className="parameter-name">getItemAsync</span>** <span className="optional-status">optional</span> `(key: string) => any`
---
**<span className="parameter-name">setItemAsync</span>** <span className="optional-status">optional</span> `(key: string, value: string) => void`
---
**<span className="parameter-name">remove</span>** <span className="optional-status">optional</span> `(options: { key: string }) => void`
---
**<span className="parameter-name">get</span>** <span className="optional-status">optional</span> `(options: { key: string }) => any`
---
**<span className="parameter-name">set</span>** <span className="optional-status">optional</span> `(options: { key: string, value: string }) => void`
---
**<span className="parameter-name">removeItem</span>** <span className="optional-status">optional</span> `(key: string) => void`
---
**<span className="parameter-name">getItem</span>** <span className="optional-status">optional</span> `(key: string) => any`
---
**<span className="parameter-name">setItem</span>** <span className="optional-status">optional</span> `(_key: string, _value: string) => void`
---

View File

@@ -0,0 +1,37 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: DeanonymizeParams
sidebar_label: DeanonymizeParams
description: No description provided.
displayed_sidebar: referenceSidebar
---
# `DeanonymizeParams`
## Parameters
---
**<span className="parameter-name">email</span>** <span className="optional-status">required</span> `string`
---
**<span className="parameter-name">signInMethod</span>** <span className="optional-status">required</span> `"email-password"` | `"passwordless"`
---
**<span className="parameter-name">allowedRoles</span>** <span className="optional-status">optional</span> `Array<string>`
---
**<span className="parameter-name">defaultRole</span>** <span className="optional-status">optional</span> `string`
---
**<span className="parameter-name">connection</span>** <span className="optional-status">optional</span> `"email"` | `"sms"`
---
**<span className="parameter-name">password</span>** <span className="optional-status">optional</span> `string`
---

View File

@@ -0,0 +1,17 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: Headers
sidebar_label: Headers
description: No description provided.
displayed_sidebar: referenceSidebar
---
# `Headers`
## Parameters
---
**<span className="parameter-name">Authorization</span>** <span className="optional-status">optional</span> `string`
---

View File

@@ -0,0 +1,21 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: LoginData
sidebar_label: LoginData
description: No description provided.
displayed_sidebar: referenceSidebar
---
# `LoginData`
## Parameters
---
**<span className="parameter-name">mfa</span>** <span className="optional-status">optional</span> `boolean`
---
**<span className="parameter-name">ticket</span>** <span className="optional-status">optional</span> `string`
---

View File

@@ -0,0 +1,17 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: Mfa
sidebar_label: Mfa
description: No description provided.
displayed_sidebar: referenceSidebar
---
# `Mfa`
## Parameters
---
**<span className="parameter-name">ticket</span>** <span className="optional-status">required</span> `string`
---

View File

@@ -0,0 +1,91 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: NhostAuthConstructorParams
sidebar_label: NhostAuthConstructorParams
description: No description provided.
displayed_sidebar: referenceSidebar
---
# `NhostAuthConstructorParams`
## Parameters
---
**<span className="parameter-name">url</span>** <span className="optional-status">required</span> `string`
---
**<span className="parameter-name">Client</span>** <span className="optional-status">optional</span> `AuthClient`
---
**<span className="parameter-name">start</span>** <span className="optional-status">optional</span> `boolean`
---
**<span className="parameter-name">autoSignIn</span>** <span className="optional-status">optional</span> `boolean`
When set to true, will parse the url on startup to check if it contains a refresh token to start the session with
---
**<span className="parameter-name deprecated">autoLogin</span>** <span className="optional-status">optional</span> `boolean`
:::caution Deprecated
use autoSignIn instead
:::
---
**<span className="parameter-name">autoRefreshToken</span>** <span className="optional-status">optional</span> `boolean`
When set to true, will automatically refresh token before it expires
---
**<span className="parameter-name">clientStorageSetter</span>** <span className="optional-status">optional</span> [`StorageSetter`](/reference/docgen/javascript/auth/types/storage-setter)
Define a way to set information about the refresh token and its exipration date
---
**<span className="parameter-name">clientStorageGetter</span>** <span className="optional-status">optional</span> [`StorageGetter`](/reference/docgen/javascript/auth/types/storage-getter)
Define a way to get information about the refresh token and its exipration date
---
**<span className="parameter-name deprecated">clientStorageType</span>** <span className="optional-status">optional</span> [`ClientStorageType`](/reference/docgen/javascript/auth/types/client-storage-type)
:::caution Deprecated
Use clientStorageGetter and clientStorageSetter options instead
:::
---
**<span className="parameter-name deprecated">clientStorage</span>** <span className="optional-status">optional</span> [`ClientStorage`](/reference/docgen/javascript/auth/types/client-storage)
:::caution Deprecated
Use clientStorageGetter and clientStorageSetter options instead
:::
| Property | Type | Required | Notes |
| :-------------------------------------------------------------------------------------------------------- | :-------------------------------------------------- | :------: | :---- |
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>deleteItemAsync</span> | `(key: string) => void` | | |
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>getItemAsync</span> | `(key: string) => any` | | |
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>setItemAsync</span> | `(key: string, value: string) => void` | | |
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>remove</span> | `(options: { key: string }) => void` | | |
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>get</span> | `(options: { key: string }) => any` | | |
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>set</span> | `(options: { key: string, value: string }) => void` | | |
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>removeItem</span> | `(key: string) => void` | | |
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>getItem</span> | `(key: string) => any` | | |
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>setItem</span> | `(_key: string, _value: string) => void` | | |
---
**<span className="parameter-name">refreshIntervalTime</span>** <span className="optional-status">optional</span> `number`
Time interval until token refreshes, in seconds
---

View File

@@ -0,0 +1,13 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: OnTokenChangedFunction
sidebar_label: OnTokenChangedFunction
description: No description provided.
displayed_sidebar: referenceSidebar
---
# `OnTokenChangedFunction`
```ts
type OnTokenChangedFunction = () => (session: Session | null) => void
```

View File

@@ -0,0 +1,24 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: Provider
sidebar_label: Provider
description: No description provided.
displayed_sidebar: referenceSidebar
---
# `Provider`
```ts
type Provider =
| 'apple'
| 'facebook'
| 'github'
| 'google'
| 'linkedin'
| 'spotify'
| 'twitter'
| 'windowslive'
| 'strava'
| 'gitlab'
| 'bitbucket'
```

View File

@@ -0,0 +1,21 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: ResetPasswordParams
sidebar_label: ResetPasswordParams
description: No description provided.
displayed_sidebar: referenceSidebar
---
# `ResetPasswordParams`
## Parameters
---
**<span className="parameter-name">email</span>** <span className="optional-status">required</span> `string`
---
**<span className="parameter-name">options</span>** <span className="optional-status">optional</span> `RedirectOption`
---

View File

@@ -0,0 +1,21 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: SendVerificationEmailParams
sidebar_label: SendVerificationEmailParams
description: No description provided.
displayed_sidebar: referenceSidebar
---
# `SendVerificationEmailParams`
## Parameters
---
**<span className="parameter-name">email</span>** <span className="optional-status">required</span> `string`
---
**<span className="parameter-name">options</span>** <span className="optional-status">optional</span> `RedirectOption`
---

View File

@@ -0,0 +1,29 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: Session
sidebar_label: Session
description: No description provided.
displayed_sidebar: referenceSidebar
---
# `Session`
## Parameters
---
**<span className="parameter-name">accessToken</span>** <span className="optional-status">required</span> `string`
---
**<span className="parameter-name">accessTokenExpiresIn</span>** <span className="optional-status">required</span> `number`
---
**<span className="parameter-name">refreshToken</span>** <span className="optional-status">required</span> `string`
---
**<span className="parameter-name">user</span>** <span className="optional-status">required</span> `null` | [`User`](/reference/docgen/javascript/auth/types/user)
---

View File

@@ -0,0 +1,21 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: SignInEmailPasswordParams
sidebar_label: SignInEmailPasswordParams
description: No description provided.
displayed_sidebar: referenceSidebar
---
# `SignInEmailPasswordParams`
## Parameters
---
**<span className="parameter-name">email</span>** <span className="optional-status">required</span> `string`
---
**<span className="parameter-name">password</span>** <span className="optional-status">required</span> `string`
---

View File

@@ -0,0 +1,18 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: SignInParams
sidebar_label: SignInParams
description: No description provided.
displayed_sidebar: referenceSidebar
---
# `SignInParams`
```ts
type SignInParams =
| SignInEmailPasswordParams
| SignInPasswordlessEmailParams
| SignInPasswordlessSmsOtpParams
| SignInPasswordlessSmsParams
| SignInWithProviderOptions
```

View File

@@ -0,0 +1,21 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: SignInPasswordlessEmailParams
sidebar_label: SignInPasswordlessEmailParams
description: No description provided.
displayed_sidebar: referenceSidebar
---
# `SignInPasswordlessEmailParams`
## Parameters
---
**<span className="parameter-name">email</span>** <span className="optional-status">required</span> `string`
---
**<span className="parameter-name">options</span>** <span className="optional-status">optional</span> `PasswordlessOptions`
---

View File

@@ -0,0 +1,21 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: SignInPasswordlessSmsOtpParams
sidebar_label: SignInPasswordlessSmsOtpParams
description: No description provided.
displayed_sidebar: referenceSidebar
---
# `SignInPasswordlessSmsOtpParams`
## Parameters
---
**<span className="parameter-name">phoneNumber</span>** <span className="optional-status">required</span> `string`
---
**<span className="parameter-name">otp</span>** <span className="optional-status">required</span> `string`
---

View File

@@ -0,0 +1,21 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: SignInPasswordlessSmsParams
sidebar_label: SignInPasswordlessSmsParams
description: No description provided.
displayed_sidebar: referenceSidebar
---
# `SignInPasswordlessSmsParams`
## Parameters
---
**<span className="parameter-name">phoneNumber</span>** <span className="optional-status">required</span> `string`
---
**<span className="parameter-name">options</span>** <span className="optional-status">optional</span> `PasswordlessOptions`
---

View File

@@ -0,0 +1,33 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: SignInReponse
sidebar_label: SignInReponse
description: No description provided.
displayed_sidebar: referenceSidebar
---
# `SignInReponse`
## Parameters
---
**<span className="parameter-name">session</span>** <span className="optional-status">required</span> `null` | [`Session`](/reference/docgen/javascript/auth/types/session)
---
**<span className="parameter-name">error</span>** <span className="optional-status">required</span> `null` | [`ApiError`](/reference/docgen/javascript/auth/types/api-error)
---
**<span className="parameter-name">mfa</span>** <span className="optional-status">optional</span> `{ enabled: boolean, ticket: string }`
---
**<span className="parameter-name">providerUrl</span>** <span className="optional-status">optional</span> `string`
---
**<span className="parameter-name">provider</span>** <span className="optional-status">optional</span> `string`
---

View File

@@ -0,0 +1,21 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: SignInWithProviderOptions
sidebar_label: SignInWithProviderOptions
description: No description provided.
displayed_sidebar: referenceSidebar
---
# `SignInWithProviderOptions`
## Parameters
---
**<span className="parameter-name">provider</span>** <span className="optional-status">required</span> [`Provider`](/reference/docgen/javascript/auth/types/provider)
---
**<span className="parameter-name">options</span>** <span className="optional-status">optional</span> `ProviderOptions`
---

View File

@@ -0,0 +1,25 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: SignUpEmailPasswordParams
sidebar_label: SignUpEmailPasswordParams
description: No description provided.
displayed_sidebar: referenceSidebar
---
# `SignUpEmailPasswordParams`
## Parameters
---
**<span className="parameter-name">password</span>** <span className="optional-status">required</span> `string`
---
**<span className="parameter-name">email</span>** <span className="optional-status">required</span> `string`
---
**<span className="parameter-name">options</span>** <span className="optional-status">optional</span> `SignUpOptions`
---

View File

@@ -0,0 +1,9 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: SignUpParams
sidebar_label: SignUpParams
description: No description provided.
displayed_sidebar: referenceSidebar
---
# `SignUpParams`

View File

@@ -0,0 +1,15 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: SignUpResponse
sidebar_label: SignUpResponse
description: No description provided.
displayed_sidebar: referenceSidebar
---
# `SignUpResponse`
```ts
type SignUpResponse =
| { session: null; error: ApiError }
| { session: Session | null; error: null }
```

View File

@@ -0,0 +1,15 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: StorageGetter
sidebar_label: StorageGetter
description: No description provided.
displayed_sidebar: referenceSidebar
---
# `StorageGetter`
```ts
type StorageGetter = () => (
key: string
) => string | null | Promise<string | null>
```

View File

@@ -0,0 +1,16 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: StorageSetter
sidebar_label: StorageSetter
description: No description provided.
displayed_sidebar: referenceSidebar
---
# `StorageSetter`
```ts
type StorageSetter = () => (
key: string,
value: string | null
) => void | Promise<void>
```

View File

@@ -0,0 +1,93 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: User
sidebar_label: User
description: User information
displayed_sidebar: referenceSidebar
---
# `User`
User information
## Parameters
---
**<span className="parameter-name">id</span>** <span className="optional-status">required</span> `string`
User's unique identifier (uuid)
---
**<span className="parameter-name">createdAt</span>** <span className="optional-status">required</span> `string`
The date-time when the user has been created
---
**<span className="parameter-name">displayName</span>** <span className="optional-status">required</span> `string`
User's display name
---
**<span className="parameter-name">avatarUrl</span>** <span className="optional-status">required</span> `string`
The URL to the user's profile picture
---
**<span className="parameter-name">locale</span>** <span className="optional-status">required</span> `string`
The locale of the user, as a two-characters string
---
**<span className="parameter-name">email</span>** <span className="optional-status">optional</span> `string`
User's email address
---
**<span className="parameter-name">isAnonymous</span>** <span className="optional-status">required</span> `boolean`
Whether or not the user is anonymous
---
**<span className="parameter-name">defaultRole</span>** <span className="optional-status">required</span> `string`
The default role of the user
---
**<span className="parameter-name">roles</span>** <span className="optional-status">required</span> `Array<string>`
The roles assigned to the user
---
**<span className="parameter-name">metadata</span>** <span className="optional-status">required</span> `Record<string, unknown>`
Additional attributes used for user information
---
**<span className="parameter-name">emailVerified</span>** <span className="optional-status">required</span> `boolean`
Is `true` if the user email has not been verified
---
**<span className="parameter-name">phoneNumber</span>** <span className="optional-status">required</span> `null` | `string`
---
**<span className="parameter-name">phoneNumberVerified</span>** <span className="optional-status">required</span> `boolean`
---
**<span className="parameter-name">activeMfaType</span>** <span className="optional-status">required</span> `null` | `"totp"`
---

View File

@@ -0,0 +1,3 @@
{
"label": "Nhost JS"
}

View File

@@ -0,0 +1,31 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: createClient()
sidebar_label: createClient()
slug: /reference/javascript/nhost-js/create-client
description: No description provided.
---
# `createClient()`
## Parameters
---
**<span className="parameter-name">config</span>** <span className="optional-status">required</span> [`NhostClientConstructorParams`](/reference/docgen/javascript/nhost-js/types/nhost-client-constructor-params)
| Property | Type | Required | Notes |
| :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------------ | :------: | :---------------------------------------------------------------------------------------------------------------- |
| <span className="parameter-name"><span className="light-grey">config.</span>backendUrl</span> | `string` | ✔️ | Nhost backend URL. |
| <span className="parameter-name"><span className="light-grey">config.</span>refreshIntervalTime</span> | `number` | | Time interval until token refreshes, in seconds |
| <span className="parameter-name deprecated"><span className="light-grey">config.</span>clientStorage</span> <span className="deprecation-sign" title="Use clientStorageGetter and clientStorageSetter options instead">⚠️</span> | `ClientStorage` | | |
| <span className="parameter-name deprecated"><span className="light-grey">config.</span>clientStorageType</span> <span className="deprecation-sign" title="Use clientStorageGetter and clientStorageSetter options instead">⚠️</span> | `ClientStorageType` | | |
| <span className="parameter-name"><span className="light-grey">config.</span>clientStorageGetter</span> | `StorageGetter` | | Define a way to get information about the refresh token and its exipration date |
| <span className="parameter-name"><span className="light-grey">config.</span>clientStorageSetter</span> | `StorageSetter` | | Define a way to set information about the refresh token and its exipration date |
| <span className="parameter-name"><span className="light-grey">config.</span>autoRefreshToken</span> | `boolean` | | When set to true, will automatically refresh token before it expires |
| <span className="parameter-name deprecated"><span className="light-grey">config.</span>autoLogin</span> <span className="deprecation-sign" title="use autoSignIn instead">⚠️</span> | `boolean` | | |
| <span className="parameter-name"><span className="light-grey">config.</span>autoSignIn</span> | `boolean` | | When set to true, will parse the url on startup to check if it contains a refresh token to start the session with |
| <span className="parameter-name"><span className="light-grey">config.</span>start</span> | `boolean` | | |
| <span className="parameter-name"><span className="light-grey">config.</span>Client</span> | `AuthClient` | | |
---

View File

@@ -0,0 +1,33 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: NhostClient
sidebar_label: NhostClient
description: No description provided.
slug: /reference/javascript/nhost-js/nhost-client
---
# `NhostClient`
Nhost Client
## Parameters
---
**<span className="parameter-name">\_\_namedParameters</span>** <span className="optional-status">required</span> [`NhostClientConstructorParams`](/reference/docgen/javascript/nhost-js/types/nhost-client-constructor-params)
| Property | Type | Required | Notes |
| :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :------------------ | :------: | :---------------------------------------------------------------------------------------------------------------- |
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>backendUrl</span> | `string` | ✔️ | Nhost backend URL. |
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>Client</span> | `AuthClient` | | |
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>start</span> | `boolean` | | |
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>autoSignIn</span> | `boolean` | | When set to true, will parse the url on startup to check if it contains a refresh token to start the session with |
| <span className="parameter-name deprecated"><span className="light-grey">\_\_namedParameters.</span>autoLogin</span> <span className="deprecation-sign" title="use autoSignIn instead">⚠️</span> | `boolean` | | |
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>autoRefreshToken</span> | `boolean` | | When set to true, will automatically refresh token before it expires |
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>clientStorageSetter</span> | `StorageSetter` | | Define a way to set information about the refresh token and its exipration date |
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>clientStorageGetter</span> | `StorageGetter` | | Define a way to get information about the refresh token and its exipration date |
| <span className="parameter-name deprecated"><span className="light-grey">\_\_namedParameters.</span>clientStorageType</span> <span className="deprecation-sign" title="Use clientStorageGetter and clientStorageSetter options instead">⚠️</span> | `ClientStorageType` | | |
| <span className="parameter-name deprecated"><span className="light-grey">\_\_namedParameters.</span>clientStorage</span> <span className="deprecation-sign" title="Use clientStorageGetter and clientStorageSetter options instead">⚠️</span> | `ClientStorage` | | |
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>refreshIntervalTime</span> | `number` | | Time interval until token refreshes, in seconds |
---

View File

@@ -0,0 +1,25 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: call()
sidebar_label: call()
slug: /reference/javascript/nhost-js/functions/call
description: No description provided.
---
# `call()`
## Parameters
---
**<span className="parameter-name">url</span>** <span className="optional-status">required</span> `string`
---
**<span className="parameter-name">data</span>** <span className="optional-status">required</span> `D`
---
**<span className="parameter-name">config</span>** <span className="optional-status">optional</span> `AxiosRequestConfig<any>`
---

View File

@@ -0,0 +1,17 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: setAccessToken()
sidebar_label: setAccessToken()
slug: /reference/javascript/nhost-js/functions/set-access-token
description: No description provided.
---
# `setAccessToken()`
## Parameters
---
**<span className="parameter-name">accessToken</span>** <span className="optional-status">required</span> `undefined` | `string`
---

View File

@@ -0,0 +1,21 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: NhostFunctionsClient
sidebar_label: Functions
description: No description provided.
slug: /reference/javascript/nhost-js/functions
---
# `NhostFunctionsClient`
## Parameters
---
**<span className="parameter-name">params</span>** <span className="optional-status">required</span> [`NhostFunctionsConstructorParams`](/reference/docgen/javascript/nhost-js/types/nhost-functions-constructor-params)
| Property | Type | Required | Notes |
| :------------------------------------------------------------------------------------- | :------- | :------: | :---- |
| <span className="parameter-name"><span className="light-grey">params.</span>url</span> | `string` | ✔️ | |
---

View File

@@ -0,0 +1,25 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: request()
sidebar_label: request()
slug: /reference/javascript/nhost-js/graphql/request
description: No description provided.
---
# `request()`
## Parameters
---
**<span className="parameter-name">document</span>** <span className="optional-status">required</span> `string` | `DocumentNode`
---
**<span className="parameter-name">variables</span>** <span className="optional-status">optional</span> `V`
---
**<span className="parameter-name">config</span>** <span className="optional-status">optional</span> `AxiosRequestConfig<any>`
---

View File

@@ -0,0 +1,9 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: getUrl()
sidebar_label: getUrl()
slug: /reference/javascript/nhost-js/graphql/get-url
description: No description provided.
---
# `getUrl()`

View File

@@ -0,0 +1,17 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: setAccessToken()
sidebar_label: setAccessToken()
slug: /reference/javascript/nhost-js/graphql/set-access-token
description: No description provided.
---
# `setAccessToken()`
## Parameters
---
**<span className="parameter-name">accessToken</span>** <span className="optional-status">required</span> `undefined` | `string`
---

View File

@@ -0,0 +1,21 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: NhostGraphqlClient
sidebar_label: GraphQL
description: No description provided.
slug: /reference/javascript/nhost-js/graphql
---
# `NhostGraphqlClient`
## Parameters
---
**<span className="parameter-name">params</span>** <span className="optional-status">required</span> [`NhostGraphqlConstructorParams`](/reference/docgen/javascript/nhost-js/types/nhost-graphql-constructor-params)
| Property | Type | Required | Notes |
| :------------------------------------------------------------------------------------- | :------- | :------: | :---- |
| <span className="parameter-name"><span className="light-grey">params.</span>url</span> | `string` | ✔️ | |
---

View File

@@ -0,0 +1,9 @@
{
"label": "Types",
"position": 1,
"className": "hidden",
"link": {
"type": "generated-index",
"slug": "/reference/docgen/javascript/nhost-js/types"
}
}

View File

@@ -0,0 +1,81 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: NhostClientConstructorParams
sidebar_label: NhostClientConstructorParams
description: No description provided.
displayed_sidebar: referenceSidebar
---
# `NhostClientConstructorParams`
## Parameters
---
**<span className="parameter-name">backendUrl</span>** <span className="optional-status">required</span> `string`
Nhost backend URL.
---
**<span className="parameter-name">refreshIntervalTime</span>** <span className="optional-status">optional</span> `number`
Time interval until token refreshes, in seconds
---
**<span className="parameter-name deprecated">clientStorage</span>** <span className="optional-status">optional</span> `ClientStorage`
:::caution Deprecated
Use clientStorageGetter and clientStorageSetter options instead
:::
---
**<span className="parameter-name deprecated">clientStorageType</span>** <span className="optional-status">optional</span> `ClientStorageType`
:::caution Deprecated
Use clientStorageGetter and clientStorageSetter options instead
:::
---
**<span className="parameter-name">clientStorageGetter</span>** <span className="optional-status">optional</span> `StorageGetter`
Define a way to get information about the refresh token and its exipration date
---
**<span className="parameter-name">clientStorageSetter</span>** <span className="optional-status">optional</span> `StorageSetter`
Define a way to set information about the refresh token and its exipration date
---
**<span className="parameter-name">autoRefreshToken</span>** <span className="optional-status">optional</span> `boolean`
When set to true, will automatically refresh token before it expires
---
**<span className="parameter-name deprecated">autoLogin</span>** <span className="optional-status">optional</span> `boolean`
:::caution Deprecated
use autoSignIn instead
:::
---
**<span className="parameter-name">autoSignIn</span>** <span className="optional-status">optional</span> `boolean`
When set to true, will parse the url on startup to check if it contains a refresh token to start the session with
---
**<span className="parameter-name">start</span>** <span className="optional-status">optional</span> `boolean`
---
**<span className="parameter-name">Client</span>** <span className="optional-status">optional</span> `AuthClient`
---

View File

@@ -0,0 +1,17 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: NhostFunctionsConstructorParams
sidebar_label: NhostFunctionsConstructorParams
description: No description provided.
displayed_sidebar: referenceSidebar
---
# `NhostFunctionsConstructorParams`
## Parameters
---
**<span className="parameter-name">url</span>** <span className="optional-status">required</span> `string`
---

View File

@@ -0,0 +1,17 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: NhostGraphqlConstructorParams
sidebar_label: NhostGraphqlConstructorParams
description: No description provided.
displayed_sidebar: referenceSidebar
---
# `NhostGraphqlConstructorParams`
## Parameters
---
**<span className="parameter-name">url</span>** <span className="optional-status">required</span> `string`
---

View File

@@ -0,0 +1,3 @@
{
"label": "Storage"
}

View File

@@ -0,0 +1,30 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: upload()
sidebar_label: upload()
slug: /reference/javascript/storage/upload
description: Use `.upload` to upload a file.
---
# `upload()`
Use `.upload` to upload a file.
```ts
storage.upload({ file })
```
## Parameters
---
**<span className="parameter-name">params</span>** <span className="optional-status">required</span> [`StorageUploadParams`](/reference/docgen/javascript/storage/types/storage-upload-params)
| Property | Type | Required | Notes |
| :------------------------------------------------------------------------------------------ | :------- | :------: | :---- |
| <span className="parameter-name"><span className="light-grey">params.</span>file</span> | `File` | ✔️ | |
| <span className="parameter-name"><span className="light-grey">params.</span>bucketId</span> | `string` | | |
| <span className="parameter-name"><span className="light-grey">params.</span>name</span> | `string` | | |
| <span className="parameter-name"><span className="light-grey">params.</span>id</span> | `string` | | |
---

View File

@@ -0,0 +1,26 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: getUrl()
sidebar_label: getUrl()
slug: /reference/javascript/storage/get-url
sidebar_class_name: deprecated
description: No description provided.
---
# `getUrl()`
:::caution Deprecated
use `.getPublicUrl` instead
:::
## Parameters
---
**<span className="parameter-name">params</span>** <span className="optional-status">required</span> [`StorageGetUrlParams`](/reference/docgen/javascript/storage/types/storage-get-url-params)
| Property | Type | Required | Notes |
| :---------------------------------------------------------------------------------------- | :------- | :------: | :---- |
| <span className="parameter-name"><span className="light-grey">params.</span>fileId</span> | `string` | ✔️ | |
---

Some files were not shown because too many files have changed in this diff Show More