Compare commits

...

107 Commits

Author SHA1 Message Date
Pilou
5ff6876aea Merge pull request #918 from nhost/changeset-release/main
chore: update versions
2022-09-05 10:54:49 +02:00
github-actions[bot]
d392ed86fb chore: update versions 2022-09-05 08:27:06 +00:00
Pilou
3bbe09c4b1 Merge pull request #917 from nhost/fix-passwordless-email-options
fix: add options to `nhost.auth.signIn({ email, options })`
2022-09-05 10:25:30 +02:00
Pierre-Louis Mercereau
a47ce29173 fix: add options to nhost.auth.signIn({ email, options }) 2022-09-05 09:57:46 +02:00
Pilou
42fba7a095 Merge pull request #907 from nhost/core-typings
fix: improve typings
2022-08-30 11:24:13 +02:00
Pierre-Louis Mercereau
0ff633760a Merge branch 'main' into core-typings 2022-08-30 11:09:05 +02:00
Pilou
6c51571182 Merge pull request #909 from nhost/bump-storage-version-0.2.4
ci: bump hasura-storage version to 0.2.4
2022-08-30 11:08:44 +02:00
Pierre-Louis Mercereau
3825a09aed ci: bump hasura-storage version to 0.2.4 2022-08-30 10:25:57 +02:00
Pierre-Louis Mercereau
1768b1e069 docs: comment types & interfaces 2022-08-30 09:23:53 +02:00
Pierre-Louis Mercereau
fba5c819ce fix: improve typings 2022-08-29 21:39:26 +02:00
Johan Eliasson
9dea25ebe1 Merge pull request #900 from nhost/changeset-release/main
chore: update versions
2022-08-25 10:58:02 +02:00
github-actions[bot]
9b063abe32 chore: update versions 2022-08-25 07:53:20 +00:00
Johan Eliasson
cea97ba333 Merge pull request #898 from nhost/changeset-iasgd9ad
adding changeset for storage upload
2022-08-25 09:52:09 +02:00
Johan Eliasson
607c457f9d adding changeset for storage upload 2022-08-25 09:14:56 +02:00
Johan Eliasson
6ea9ed69ce Merge pull request #893 from nhost/fix/storage-in-node
Make @nhost/storage-js work on non-browser environments
2022-08-25 09:03:16 +02:00
Johan Eliasson
6450dcc02e overloading 2022-08-25 08:20:31 +02:00
Johan Eliasson
0b18704d5b updates 2022-08-24 18:04:07 +02:00
Johan Eliasson
0c53f9034e adding empty functions folder for nhost-js 2022-08-24 15:07:52 +02:00
Johan Eliasson
0c90292779 adding correct health check endpoints and new vite config files where needed 2022-08-24 15:05:24 +02:00
Johan Eliasson
2333aeb0c8 no tests 2022-08-24 14:58:13 +02:00
Johan Eliasson
3b686a231b use GET request 2022-08-24 14:47:01 +02:00
Johan Eliasson
136b85c5fb add empty package.json in the functions folder 2022-08-24 13:53:30 +02:00
Johan Eliasson
3d715d5f95 wait for hasura console to be up' 2022-08-24 10:38:34 +02:00
Johan Eliasson
6d5295aeca exclude is not needed as we're using include 2022-08-24 10:29:26 +02:00
Johan Eliasson
45f6285249 vite config for storage-js 2022-08-24 10:21:02 +02:00
Pierre-Louis Mercereau
01fb999c7d ci: remove chown 2022-08-24 10:14:52 +02:00
Johan Eliasson
8b8412d5fa exclude paths for vitest 2022-08-24 10:11:51 +02:00
Pierre-Louis Mercereau
0f1311c5b0 ci: correct gh expression 2022-08-24 10:09:34 +02:00
Pierre-Louis Mercereau
6b197aa886 ci: chown package folder 2022-08-24 10:05:14 +02:00
Pierre-Louis Mercereau
0353c6648e ci: change permissions 2022-08-24 09:58:55 +02:00
Johan Eliasson
978b8f8f68 install cli as sudo 2022-08-24 09:37:06 +02:00
Johan Eliasson
3643449a9a update 2022-08-24 07:59:04 +02:00
Johan Eliasson
8e25971e7d move nhost folder 2022-08-24 07:44:24 +02:00
Johan Eliasson
5cf05c8731 correct config 2022-08-23 13:51:48 +02:00
Johan Eliasson
4da70abcfb cleanup 2022-08-23 13:50:31 +02:00
Johan Eliasson
2d5203872c delete test functions folder 2022-08-23 13:49:31 +02:00
Johan Eliasson
882f1531ab update types and docs 2022-08-23 13:47:48 +02:00
Johan Eliasson
6126d77b01 updated tests 2022-08-23 13:47:48 +02:00
Johan Eliasson
09debbd746 Merge branch 'main' into fix/storage-in-node 2022-08-23 12:12:51 +02:00
Johan Eliasson
604ed6b314 readme update 2022-08-23 12:12:11 +02:00
Johan Eliasson
2f1fec1dcf new tests 2022-08-23 12:07:19 +02:00
Johan Eliasson
293bdc3f1c Merge pull request #892 from nhost/changeset-release/main
chore: update versions
2022-08-23 08:55:17 +02:00
Johan Eliasson
70f537841f make storage work on server 2022-08-23 08:01:28 +02:00
github-actions[bot]
b670dc396b chore: update versions 2022-08-22 20:19:44 +00:00
Pilou
88800ba4b4 Merge pull request #786 from nhost/feature/fallback-to-1337
Use :1337 if no port is specified when using "localhost"
2022-08-22 22:18:01 +02:00
Johan Eliasson
d412669c86 removed pnpm lock files in examples 2022-08-22 22:01:03 +02:00
Johan Eliasson
8600acb6f2 Merge branch 'main' into feature/fallback-to-1337 2022-08-22 21:57:31 +02:00
Johan Eliasson
0e2e2344f2 Merge pull request #891 from nhost/fix-cli-update
CLI update fixes
2022-08-22 21:55:51 +02:00
Johan Eliasson
8a91673242 removed pnpm lock files in examples 2022-08-22 21:41:42 +02:00
Pierre-Louis Mercereau
63f27235be refactor: adapt sync-versions to the new cli 2022-08-22 21:34:53 +02:00
Johan Eliasson
7feadbe55d nhost cli updates 2022-08-22 21:25:19 +02:00
Johan Eliasson
98e5680f48 nhost-js package updated 2022-08-22 20:46:07 +02:00
Johan Eliasson
8d6ebf9032 updated config 2022-08-22 20:35:52 +02:00
Johan Eliasson
9feea987e6 remove tmp cypress folders 2022-08-22 20:25:16 +02:00
Johan Eliasson
c2d77bbb7c updated example with latest CLI 2022-08-22 20:18:46 +02:00
Johan Eliasson
4468654054 new config for new cli 2022-08-22 19:55:41 +02:00
Johan Eliasson
998291ea9d correct subdomain 2022-08-22 19:35:07 +02:00
Johan Eliasson
eb46f7d8b7 Create great-adults-compare.md 2022-08-22 19:33:32 +02:00
Johan Eliasson
7bc11a1985 subdomain don't need 1337 2022-08-22 19:31:58 +02:00
Johan Eliasson
0fadc0d3da code + nhost cli updates 2022-08-22 19:26:38 +02:00
Johan Eliasson
814856da0d Merge branch 'main' into feature/fallback-to-1337 2022-08-22 18:43:08 +02:00
Johan Eliasson
1bf5114d6b updates 2022-08-22 18:42:28 +02:00
Johan Eliasson
ed618e0c41 Merge pull request #887 from nhost/remove-templates
Remove templates
2022-08-22 18:14:11 +02:00
Pilou
8a272b5b72 Merge pull request #883 from nhost/docker-email-templates
docs: add email templates to docker-compose, and remove obsolete example
2022-08-22 16:53:43 +02:00
Johan Eliasson
2a0107db55 removed mentions of templates/ 2022-08-22 16:46:36 +02:00
Johan Eliasson
48a90c4f69 remove templates 2022-08-19 13:02:03 +02:00
Pilou
686d3f1b09 Merge pull request #884 from nhost/bump-hasura-2.10.1
Bump hasura version to 2.10.1
2022-08-17 17:59:24 +02:00
Pierre-Louis Mercereau
6b4b4a5798 chore: bump hasura version to 2.10.1 2022-08-17 08:27:59 +02:00
Pierre-Louis Mercereau
3a14b90557 docs: add email templates to docker-compose, and remove obsolete example
the `custom-email-templates` is obsolete as it is now possible to deploy templates with the Nhost GH
integration
2022-08-16 11:02:26 +02:00
Szilárd Dóró
9871bd42e0 Merge pull request #863 from nhost/changeset-release/main
chore: update versions
2022-08-10 10:26:48 +02:00
github-actions[bot]
7982702e26 chore: update versions 2022-08-09 06:53:50 +00:00
Johan Eliasson
7e21fe5c2b Merge pull request #871 from nhost/use-project-wording
Terminology: app -> project
2022-08-09 08:52:17 +02:00
Johan Eliasson
cc4d2ee81a Merge pull request #872 from nhost/storage-fixes-123iygasd
Storage typos
2022-08-05 18:06:37 +02:00
Johan Eliasson
a96adbcd9d sotrage typos 2022-08-05 16:23:35 +02:00
Johan Eliasson
f1ad4a37db u 2022-08-05 11:23:53 +02:00
Johan Eliasson
83b4f7c0eb project overview 2022-08-05 11:18:07 +02:00
Johan Eliasson
45fd0669ee updates 2022-08-05 11:14:33 +02:00
Johan Eliasson
d20add9329 update 2022-08-05 10:08:29 +02:00
Johan Eliasson
58854835e0 upadtes 2022-08-05 10:07:04 +02:00
Johan Eliasson
88a6f3f500 typo 2022-08-05 10:03:49 +02:00
Johan Eliasson
8336e53931 package updates 2022-08-05 10:01:03 +02:00
Johan Eliasson
674fd66922 more updates 2022-08-05 09:55:10 +02:00
Johan Eliasson
fc94bfdd66 app -> project 2022-08-05 08:33:53 +02:00
Johan Eliasson
f299578d69 Merge pull request #868 from nhost/contributors-readme-action-DOCBwXss13
contributors readme action update
2022-08-02 20:42:55 +02:00
github-actions[bot]
221032f087 contrib-readme-action has updated readme 2022-08-02 18:42:13 +00:00
Johan Eliasson
72799762c9 Merge pull request #842 from nhost/example/react-query
GraphQL Code Generator with React Query
2022-08-02 20:41:54 +02:00
Johan Eliasson
6464584d71 updated to react query v4 2022-08-02 20:23:20 +02:00
Johan Eliasson
7ca196955a Merge branch 'main' into example/react-query 2022-08-02 20:08:09 +02:00
Johan Eliasson
90b84ea8c4 Update examples/codegen-react-query/README.md
Co-authored-by: Guido Curcio <guidomaurocurcio@gmail.com>
2022-07-31 09:53:51 +02:00
Johan Eliasson
7ca3c42d23 Apply suggestions from code review
Co-authored-by: Guido Curcio <guidomaurocurcio@gmail.com>
2022-07-31 09:53:42 +02:00
Nuno Pato
bb10741334 Merge pull request #860 from nhost/fix/update-wrong-docs
fix docs
2022-07-28 17:48:26 +00:00
Nuno Pato
50293e7dd8 fix messaging around the folder structure created by nhost init 2022-07-28 17:39:06 +00:00
Nuno Pato
bebe65c4c5 remove -n from --remote 2022-07-28 17:33:15 +00:00
Szilárd Dóró
e2f5cfe9c0 Merge pull request #861 from nhost/contributors-readme-action-NCWsLhOUvy
contributors readme action update
2022-07-28 16:09:52 +02:00
github-actions[bot]
cac64f70c4 contrib-readme-action has updated readme 2022-07-28 14:09:18 +00:00
Szilárd Dóró
302e0aa1e0 Merge pull request #850 from mdp18/docs/js-passwordless-clarify
Update for reference docs 02-sign-in.mdx
2022-07-28 16:08:59 +02:00
Szilárd Dóró
e6a44dc008 chore: auto-generated documentation updates 2022-07-28 14:48:29 +02:00
Szilárd Dóró
93cc6920b6 added changesets 2022-07-28 14:47:15 +02:00
Nuno Pato
4c6e9c7839 fix docs 2022-07-28 11:44:41 +00:00
Max
f4a1eef3d4 fix 2
reversed mdx file and added fix to hasura-auth-client
2022-07-25 13:24:24 -07:00
Szilárd Dóró
2766875ff7 Merge pull request #852 from LucasBois1/patch-1
Typo fix storage.mdx
2022-07-25 15:21:19 +02:00
Lucas Bois
ea61275404 Typo fix storage.mdx 2022-07-23 10:47:01 -03:00
Max
1191cb4fd8 Update 02-sign-in.mdx 2022-07-22 15:10:29 -07:00
Pilou
f6e1517a7a Merge pull request #843 from nhost/contributors-readme-action-O05tbtr6_i
contributors readme action update
2022-07-19 11:11:07 +02:00
github-actions[bot]
e15cb8b798 contrib-readme-action has updated readme 2022-07-19 08:43:33 +00:00
Johan Eliasson
736b0512da meta updates 2022-07-19 10:22:45 +02:00
Nuno Pato
5485d48ce5 Use :1337 if no port is specified when using "localhost" 2022-07-04 00:14:46 +00:00
503 changed files with 10331 additions and 66648 deletions

View File

@@ -5,7 +5,6 @@ on:
branches: [main] branches: [main]
paths-ignore: paths-ignore:
- 'docs/**' - 'docs/**'
- 'templates/**'
- 'examples/**' - 'examples/**'
- 'assets/**' - 'assets/**'
- '**.md' - '**.md'

View File

@@ -5,7 +5,6 @@ on:
branches: [main] branches: [main]
paths-ignore: paths-ignore:
- 'docs/**' - 'docs/**'
- 'templates/**'
- 'assets/**' - 'assets/**'
- '**.md' - '**.md'
- 'LICENSE' - 'LICENSE'
@@ -14,7 +13,6 @@ on:
types: [opened, synchronize] types: [opened, synchronize]
paths-ignore: paths-ignore:
- 'docs/**' - 'docs/**'
- 'templates/**'
- 'assets/**' - 'assets/**'
- '**.md' - '**.md'
- 'LICENSE' - 'LICENSE'

View File

@@ -87,12 +87,12 @@ await nhost.graphql.request(`{
Nhost is frontend agnostic, which means Nhost works with all frontend frameworks. Nhost is frontend agnostic, which means Nhost works with all frontend frameworks.
<div align="center"> <div align="center">
<a href="https://github.com/nhost/nhost/tree/main/templates/web/nextjs-apollo"><img src="assets/nextjs.svg"/></a> <a href="https://docs.nhost.io/platform/quickstarts/nextjs"><img src="assets/nextjs.svg"/></a>
<a href="https://github.com/nhost/nhost/tree/main/examples/nuxt-apollo"><img src="assets/nuxtjs.svg"/></a> <a href="https://docs.nhost.io/reference/javascript"><img src="assets/nuxtjs.svg"/></a>
<a href="https://github.com/nhost/nhost/tree/main/templates/web/react-apollo"><img src="assets/react.svg"/></a> <a href="https://docs.nhost.io/platform/quickstarts/react"><img src="assets/react.svg"/></a>
<img src="assets/react-native.svg"/> <a href="https://docs.nhost.io/reference/javascript"><img src="assets/react-native.svg"/></a>
<a href="https://github.com/nhost/nhost/tree/main/packages/nhost-js"><img src="assets/svelte.svg"/></a> <a href="https://docs.nhost.io/reference/javascript"><img src="assets/svelte.svg"/></a>
<a href="https://github.com/nhost/nhost/tree/main/packages/nhost-js"><img src="assets/vuejs.svg"/></a> <a href="https://docs.nhost.io/platform/quickstarts/vue"><img src="assets/vuejs.svg"/></a>
</div> </div>
# Resources # Resources
@@ -147,6 +147,13 @@ Here are some ways of contributing to making Nhost better:
<sub><b>Johan Eliasson</b></sub> <sub><b>Johan Eliasson</b></sub>
</a> </a>
</td> </td>
<td align="center">
<a href="https://github.com/nunopato">
<img src="https://avatars.githubusercontent.com/u/1523504?v=4" width="100;" alt="nunopato"/>
<br />
<sub><b>Nuno Pato</b></sub>
</a>
</td>
<td align="center"> <td align="center">
<a href="https://github.com/gdangelo"> <a href="https://github.com/gdangelo">
<img src="https://avatars.githubusercontent.com/u/4352286?v=4" width="100;" alt="gdangelo"/> <img src="https://avatars.githubusercontent.com/u/4352286?v=4" width="100;" alt="gdangelo"/>
@@ -155,10 +162,10 @@ Here are some ways of contributing to making Nhost better:
</a> </a>
</td> </td>
<td align="center"> <td align="center">
<a href="https://github.com/nunopato"> <a href="https://github.com/szilarddoro">
<img src="https://avatars.githubusercontent.com/u/1523504?v=4" width="100;" alt="nunopato"/> <img src="https://avatars.githubusercontent.com/u/310881?v=4" width="100;" alt="szilarddoro"/>
<br /> <br />
<sub><b>Nuno Pato</b></sub> <sub><b>Szilárd Dóró</b></sub>
</a> </a>
</td> </td>
<td align="center"> <td align="center">
@@ -167,15 +174,15 @@ Here are some ways of contributing to making Nhost better:
<br /> <br />
<sub><b>Guido Curcio</b></sub> <sub><b>Guido Curcio</b></sub>
</a> </a>
</td> </td></tr>
<tr>
<td align="center"> <td align="center">
<a href="https://github.com/subatuba21"> <a href="https://github.com/subatuba21">
<img src="https://avatars.githubusercontent.com/u/34824571?v=4" width="100;" alt="subatuba21"/> <img src="https://avatars.githubusercontent.com/u/34824571?v=4" width="100;" alt="subatuba21"/>
<br /> <br />
<sub><b>Subha Das</b></sub> <sub><b>Subha Das</b></sub>
</a> </a>
</td></tr> </td>
<tr>
<td align="center"> <td align="center">
<a href="https://github.com/sebagudelo"> <a href="https://github.com/sebagudelo">
<img src="https://avatars.githubusercontent.com/u/43288271?v=4" width="100;" alt="sebagudelo"/> <img src="https://avatars.githubusercontent.com/u/43288271?v=4" width="100;" alt="sebagudelo"/>
@@ -197,13 +204,6 @@ Here are some ways of contributing to making Nhost better:
<sub><b>Pratim</b></sub> <sub><b>Pratim</b></sub>
</a> </a>
</td> </td>
<td align="center">
<a href="https://github.com/szilarddoro">
<img src="https://avatars.githubusercontent.com/u/310881?v=4" width="100;" alt="szilarddoro"/>
<br />
<sub><b>Szilárd Dóró</b></sub>
</a>
</td>
<td align="center"> <td align="center">
<a href="https://github.com/GavanWilhite"> <a href="https://github.com/GavanWilhite">
<img src="https://avatars.githubusercontent.com/u/2085119?v=4" width="100;" alt="GavanWilhite"/> <img src="https://avatars.githubusercontent.com/u/2085119?v=4" width="100;" alt="GavanWilhite"/>
@@ -276,6 +276,13 @@ Here are some ways of contributing to making Nhost better:
<sub><b>Jerry Jäppinen</b></sub> <sub><b>Jerry Jäppinen</b></sub>
</a> </a>
</td> </td>
<td align="center">
<a href="https://github.com/mdp18">
<img src="https://avatars.githubusercontent.com/u/11698527?v=4" width="100;" alt="mdp18"/>
<br />
<sub><b>Max</b></sub>
</a>
</td>
<td align="center"> <td align="center">
<a href="https://github.com/mustafa-hanif"> <a href="https://github.com/mustafa-hanif">
<img src="https://avatars.githubusercontent.com/u/30019262?v=4" width="100;" alt="mustafa-hanif"/> <img src="https://avatars.githubusercontent.com/u/30019262?v=4" width="100;" alt="mustafa-hanif"/>
@@ -296,6 +303,14 @@ Here are some ways of contributing to making Nhost better:
<br /> <br />
<sub><b>Savin Vadim</b></sub> <sub><b>Savin Vadim</b></sub>
</a> </a>
</td></tr>
<tr>
<td align="center">
<a href="https://github.com/Svarto">
<img src="https://avatars.githubusercontent.com/u/24279217?v=4" width="100;" alt="Svarto"/>
<br />
<sub><b>Svarto</b></sub>
</a>
</td> </td>
<td align="center"> <td align="center">
<a href="https://github.com/muttenzer"> <a href="https://github.com/muttenzer">
@@ -303,8 +318,7 @@ Here are some ways of contributing to making Nhost better:
<br /> <br />
<sub><b>Muttenzer</b></sub> <sub><b>Muttenzer</b></sub>
</a> </a>
</td></tr> </td>
<tr>
<td align="center"> <td align="center">
<a href="https://github.com/ahmic"> <a href="https://github.com/ahmic">
<img src="https://avatars.githubusercontent.com/u/13452362?v=4" width="100;" alt="ahmic"/> <img src="https://avatars.githubusercontent.com/u/13452362?v=4" width="100;" alt="ahmic"/>
@@ -332,6 +346,14 @@ Here are some ways of contributing to making Nhost better:
<br /> <br />
<sub><b>Colin Broderick</b></sub> <sub><b>Colin Broderick</b></sub>
</a> </a>
</td></tr>
<tr>
<td align="center">
<a href="https://github.com/dminkovsky">
<img src="https://avatars.githubusercontent.com/u/218725?v=4" width="100;" alt="dminkovsky"/>
<br />
<sub><b>Dmitry Minkovsky</b></sub>
</a>
</td> </td>
<td align="center"> <td align="center">
<a href="https://github.com/dohomi"> <a href="https://github.com/dohomi">
@@ -346,8 +368,7 @@ Here are some ways of contributing to making Nhost better:
<br /> <br />
<sub><b>Gaurav Agrawal</b></sub> <sub><b>Gaurav Agrawal</b></sub>
</a> </a>
</td></tr> </td>
<tr>
<td align="center"> <td align="center">
<a href="https://github.com/alveshelio"> <a href="https://github.com/alveshelio">
<img src="https://avatars.githubusercontent.com/u/8176422?v=4" width="100;" alt="alveshelio"/> <img src="https://avatars.githubusercontent.com/u/8176422?v=4" width="100;" alt="alveshelio"/>
@@ -368,7 +389,8 @@ Here are some ways of contributing to making Nhost better:
<br /> <br />
<sub><b>Jacob Duval</b></sub> <sub><b>Jacob Duval</b></sub>
</a> </a>
</td> </td></tr>
<tr>
<td align="center"> <td align="center">
<a href="https://github.com/kylehayes"> <a href="https://github.com/kylehayes">
<img src="https://avatars.githubusercontent.com/u/509932?v=4" width="100;" alt="kylehayes"/> <img src="https://avatars.githubusercontent.com/u/509932?v=4" width="100;" alt="kylehayes"/>
@@ -383,14 +405,20 @@ Here are some ways of contributing to making Nhost better:
<sub><b>Leo Thorp</b></sub> <sub><b>Leo Thorp</b></sub>
</a> </a>
</td> </td>
<td align="center">
<a href="https://github.com/LucasBois1">
<img src="https://avatars.githubusercontent.com/u/44686060?v=4" width="100;" alt="LucasBois1"/>
<br />
<sub><b>Lucas Bois</b></sub>
</a>
</td>
<td align="center"> <td align="center">
<a href="https://github.com/MarcelloTheArcane"> <a href="https://github.com/MarcelloTheArcane">
<img src="https://avatars.githubusercontent.com/u/21159570?v=4" width="100;" alt="MarcelloTheArcane"/> <img src="https://avatars.githubusercontent.com/u/21159570?v=4" width="100;" alt="MarcelloTheArcane"/>
<br /> <br />
<sub><b>Max Reynolds</b></sub> <sub><b>Max Reynolds</b></sub>
</a> </a>
</td></tr> </td>
<tr>
<td align="center"> <td align="center">
<a href="https://github.com/nachoaldamav"> <a href="https://github.com/nachoaldamav">
<img src="https://avatars.githubusercontent.com/u/22749943?v=4" width="100;" alt="nachoaldamav"/> <img src="https://avatars.githubusercontent.com/u/22749943?v=4" width="100;" alt="nachoaldamav"/>
@@ -404,7 +432,8 @@ Here are some ways of contributing to making Nhost better:
<br /> <br />
<sub><b>Nirmalya Ghosh</b></sub> <sub><b>Nirmalya Ghosh</b></sub>
</a> </a>
</td> </td></tr>
<tr>
<td align="center"> <td align="center">
<a href="https://github.com/quentin-decre"> <a href="https://github.com/quentin-decre">
<img src="https://avatars.githubusercontent.com/u/1137511?v=4" width="100;" alt="quentin-decre"/> <img src="https://avatars.githubusercontent.com/u/1137511?v=4" width="100;" alt="quentin-decre"/>

View File

@@ -1,5 +1,11 @@
# @nhost/docs # @nhost/docs
## 0.0.3
### Patch Changes
- eb46f7d8: Use port 1337 if no port is specified when using "localhost" as `subdomain`.
## 0.0.2 ## 0.0.2
### Patch Changes ### Patch Changes

View File

@@ -12,11 +12,11 @@ The following email templates are available:
- **signin-passwordless** - Magic Link - **signin-passwordless** - Magic Link
- **password-reset** - Reset password - **password-reset** - Reset password
Changing email templates is only available for apps on the [Pro and Enterprise plan](https://nhost.io/pricing). Changing email templates is only available for projects on the [Pro and Enterprise plan](https://nhost.io/pricing).
## Update Email Templates ## Update Email Templates
Your app must be connected to a GitHub repository using the [GitHub Integration](/platform/github-integration) to be able to change the email templates. Your project must be connected to a GitHub repository using the [GitHub Integration](/platform/github-integration) to be able to change the email templates.
Email templates are automatically deployed during a deployment, just like database migrations, Hasura metadata, and Serverless Functions. Email templates are automatically deployed during a deployment, just like database migrations, Hasura metadata, and Serverless Functions.
@@ -29,7 +29,7 @@ The email templates should be provided as body.html and subject.txt files in thi
**Example:** Email templates for `en` (English) and `es` (Spanish): **Example:** Email templates for `en` (English) and `es` (Spanish):
```txt ```txt
my-nhost-app/ my-nhost-project/
└── nhost/ └── nhost/
├── config.yaml ├── config.yaml
├── emails/ ├── emails/
@@ -70,7 +70,7 @@ As you see, the format is:
nhost/emails/{two-letter-language-code}/{email-template}/[subject.txt, body.html] nhost/emails/{two-letter-language-code}/{email-template}/[subject.txt, body.html]
``` ```
Default templates for English (`en`) and French (`fr`) are automatically generated when the app is initialized with the [CLI](/platform/cli). Default templates for English (`en`) and French (`fr`) are automatically generated when the project is initialized with the [CLI](/platform/cli).
## Languages ## Languages

View File

@@ -7,7 +7,7 @@ image: /img/og/platform/authentication.png
Nhost Authentication is a ready-to-use authentication service that is integrated with the [GraphQL API](/platform/graphql) and its permission system from Hasura. Nhost Authentication is a ready-to-use authentication service that is integrated with the [GraphQL API](/platform/graphql) and its permission system from Hasura.
Nhost Authentication lets you authenticate users to your app using different sign-in methods: Nhost Authentication lets you authenticate users using different sign-in methods:
- [Email and Password](/platform/authentication/sign-in-with-email-and-password) - [Email and Password](/platform/authentication/sign-in-with-email-and-password)
- [Magic Link](/platform/authentication/sign-in-with-magic-link) - [Magic Link](/platform/authentication/sign-in-with-magic-link)

View File

@@ -7,7 +7,7 @@ image: /img/og/platform/sign-in-with-email-and-password.png
Follow this guide to sign in users with email and password. Follow this guide to sign in users with email and password.
The email and password sign-in method is enabled by default for all Nhost apps. The email and password sign-in method is enabled by default for all Nhost projects.
## Sign Up ## Sign Up
@@ -22,7 +22,7 @@ await nhost.auth.signUp({
}) })
``` ```
If you've turned on email verification in your app's **Authentication Settings**, a user will be sent a verification email upon signup. The user must click the verification link in the email before they can sign in. If you've turned on email verification in your project's **Authentication Settings**, a user will be sent a verification email upon signup. The user must click the verification link in the email before they can sign in.
## Sign In ## Sign In
@@ -39,6 +39,6 @@ await nhost.auth.signIn({
## Verified Emails ## Verified Emails
You can decide if only verified emails should be able to sign in or not. Modify the **Only allow login for verified emails.** setting in the **Authentication Settings** section under **Users** in your Nhost app. You can decide if only verified emails should be able to sign in or not. Modify the **Only allow users with verified emails to sign in.** setting in the **Authentication Settings** section under **Users** in your Nhost project.
An email-verification email is automatically sent to the user during sign-up if your app only allows to sign in users with verified emails. You can also manually send the verification email to the user using [`nhost.auth.sendVerificationEmail()`](/reference/javascript/auth/send-verification-email). An email-verification email is automatically sent to the user during sign-up if your project only allows to sign in users with verified emails. You can also manually send the verification email to the user using [`nhost.auth.sendVerificationEmail()`](/reference/javascript/auth/send-verification-email).

View File

@@ -7,7 +7,7 @@ image: /img/og/platform/sign-in-with-magic-link.png
Follow this guide to sign in users with Magic Link, also called passwordless email. Follow this guide to sign in users with Magic Link, also called passwordless email.
The Magic Link sign-in method enables you to sign in users to your app using an email address, without requiring a password. The Magic Link sign-in method enables you to sign in users using an email address, without requiring a password.
## Setup ## Setup
@@ -20,9 +20,9 @@ Enable the Magic Link sign-in method in the Nhost dashboard under **Users** -> *
To sign in users with Magic Link is a two-step process: To sign in users with Magic Link is a two-step process:
1. Send a Magic Link to the user's email address. 1. Send a Magic Link to the user's email address.
2. The user clicks the Magic Link in their email to sign in to your app. 2. The user clicks the Magic Link in their email to sign in.
Use the [Nhost JavaScript client](/reference/javascript) to sign up users with Magic Link in your app: Use the [Nhost JavaScript client](/reference/javascript) to sign in users with Magic Link:
```js ```js
nhost.auth.signIn({ nhost.auth.signIn({

View File

@@ -5,7 +5,7 @@ slug: /platform/authentication/sign-in-with-apple
image: /img/og/platform/sign-in-with-apple.png image: /img/og/platform/sign-in-with-apple.png
--- ---
Follow this guide to sign in users with Apple with your Nhost App. Follow this guide to sign in users with Apple.
<p align="center"> <p align="center">
<img <img
@@ -89,7 +89,7 @@ Follow this guide to sign in users with Apple with your Nhost App.
## Sign In Users ## Sign In Users
Use the [Nhost JavaScript client](/reference/javascript) to sign in users in your app: Use the [Nhost JavaScript client](/reference/javascript) to sign in users:
```js ```js
nhost.auth.signIn({ nhost.auth.signIn({

View File

@@ -5,7 +5,7 @@ slug: /platform/authentication/sign-in-with-discord
image: /img/og/platform/sign-in-with-discord.png image: /img/og/platform/sign-in-with-discord.png
--- ---
Follow this guide to sign in users with Discord with your Nhost App. Follow this guide to sign in users with Discord.
<p align="center"> <p align="center">
<img <img
@@ -36,7 +36,7 @@ Follow this guide to sign in users with Discord with your Nhost App.
## Sign In Users ## Sign In Users
Use the [Nhost JavaScript client](/reference/javascript) to sign in users in your app: Use the [Nhost JavaScript client](/reference/javascript) to sign in users:
```js ```js
nhost.auth.signIn({ nhost.auth.signIn({

View File

@@ -5,7 +5,7 @@ slug: /platform/authentication/sign-in-with-facebook
image: /img/og/platform/sign-in-with-facebook.png image: /img/og/platform/sign-in-with-facebook.png
--- ---
Follow this guide to sign in users with Facebook with your Nhost App. Follow this guide to sign in users with Facebook.
<p align="center"> <p align="center">
<img <img
@@ -59,7 +59,7 @@ To make sure we can fetch all user data (email, profile picture and name). For t
## Sign In Users ## Sign In Users
Use the [Nhost JavaScript client](/reference/javascript) to sign in users in your app: Use the [Nhost JavaScript client](/reference/javascript) to sign in users:
```js ```js
nhost.auth.signIn({ nhost.auth.signIn({

View File

@@ -5,7 +5,7 @@ slug: /platform/authentication/sign-in-with-github
image: /img/og/platform/sign-in-with-github.png image: /img/og/platform/sign-in-with-github.png
--- ---
Follow this guide to sign in users with GitHub with your Nhost App. Follow this guide to sign in users with GitHub.
<p align="center"> <p align="center">
<img <img
@@ -44,7 +44,7 @@ Follow this guide to sign in users with GitHub with your Nhost App.
## Sign In Users ## Sign In Users
Use the [Nhost JavaScript client](/reference/javascript) to sign in users in your app: Use the [Nhost JavaScript client](/reference/javascript) to sign in users:
```js ```js
nhost.auth.signIn({ nhost.auth.signIn({

View File

@@ -5,7 +5,7 @@ slug: /platform/authentication/sign-in-with-google
image: /img/og/platform/sign-in-with-google.png image: /img/og/platform/sign-in-with-google.png
--- ---
Follow this guide to sign in users with Google with your Nhost App. Follow this guide to sign in users with Google.
<p align="center"> <p align="center">
<img <img
@@ -68,7 +68,7 @@ Follow this guide to sign in users with Google with your Nhost App.
## Sign In Users ## Sign In Users
Use the Nhost JavaScript client to sign in users in your app: Use the Nhost JavaScript client to sign in users:
```js ```js
nhost.auth.signIn({ nhost.auth.signIn({

View File

@@ -5,7 +5,7 @@ slug: /platform/authentication/sign-in-with-linkedin
image: /img/og/platform/sign-in-with-linkedin.png image: /img/og/platform/sign-in-with-linkedin.png
--- ---
Follow this guide to sign in users with LinkedIn with your Nhost App. Follow this guide to sign in users with LinkedIn.
<p align="center"> <p align="center">
<img <img
@@ -51,7 +51,7 @@ Follow this guide to sign in users with LinkedIn with your Nhost App.
## Sign In Users ## Sign In Users
Use the [Nhost JavaScript client](/reference/javascript) to sign in users in your app: Use the [Nhost JavaScript client](/reference/javascript) to sign in users:
```js ```js
nhost.auth.signIn({ nhost.auth.signIn({

View File

@@ -5,7 +5,7 @@ slug: /platform/authentication/sign-in-with-spotify
image: /img/og/platform/sign-in-with-spotify.png image: /img/og/platform/sign-in-with-spotify.png
--- ---
Follow this guide to sign in users with Spotify with your Nhost App. Follow this guide to sign in users with Spotify.
<p align="center"> <p align="center">
<img <img
@@ -44,7 +44,7 @@ Follow this guide to sign in users with Spotify with your Nhost App.
## Sign In Users ## Sign In Users
Use the [Nhost JavaScript client](/reference/javascript) to sign in users in your app: Use the [Nhost JavaScript client](/reference/javascript) to sign in users:
```js ```js
nhost.auth.signIn({ nhost.auth.signIn({

View File

@@ -5,7 +5,7 @@ slug: /platform/authentication/sign-in-with-twitch
image: /img/og/platform/sign-in-with-twitch.png image: /img/og/platform/sign-in-with-twitch.png
--- ---
Follow this guide to sign in users with Twitch with your Nhost App. Follow this guide to sign in users with Twitch.
<p align="center"> <p align="center">
<img <img
@@ -38,7 +38,7 @@ Follow this guide to sign in users with Twitch with your Nhost App.
## Sign In Users ## Sign In Users
Use the [Nhost JavaScript client](/reference/javascript) to sign in users in your app: Use the [Nhost JavaScript client](/reference/javascript) to sign in users:
```js ```js
nhost.auth.signIn({ nhost.auth.signIn({

View File

@@ -17,13 +17,13 @@ Nhost Authentication support the following sign-in methods:
## Enabling Social Sign-In Provider ## Enabling Social Sign-In Provider
To start with social sign-in, select your app in Nhost Console and go to **Users****Authentication Settings**. To start with social sign-in, select your project in Nhost Dashboard and go to **Users****Authentication Settings**.
You need to set the Client ID and Client Secret for each provider that you want to enable. You need to set the Client ID and Client Secret for each provider that you want to enable.
## Implementing sign-in experience ## Implementing sign-in experience
Use the [Nhost JavaScript SDK](/reference/javascript) 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 for your project.
Here's an example of how to implement sign-in with GitHub: Here's an example of how to implement sign-in with GitHub:
@@ -33,8 +33,7 @@ nhost.auth.signIn({
}) })
``` ```
Users are redirected to your Nhost app's **client URL** by default. By default, your Nhost app's client URL is set to `http://localhost:3000`. You can change the value of your client URL in the Nhost console by going to **Users****Authentication Settings****Client URL**. Users are redirected to your Nhost project's **client URL** by default. By default, your Nhost project's client URL is set to `http://localhost:3000`. You can change the value of your client URL in the Nhost console by going to **Users****Authentication Settings****Client URL**.
Here is an example of how to redirect to another host or path: Here is an example of how to redirect to another host or path:
@@ -51,7 +50,7 @@ nhost.auth.signIn({
Scopes are a mechanism in OAuth to allow or limit an application's access to a user's account. Scopes are a mechanism in OAuth to allow or limit an application's access to a user's account.
By default, Nhost sets the scope to get the name, email, and avatar url for each user. Editing scope is not currently supported. By default, Nhost sets the scope to get the name, email, and avatar URL for each user. Editing scope is not currently supported.
## Provider OAuth Tokens ## Provider OAuth Tokens

View File

@@ -7,9 +7,9 @@ image: /img/og/platform/cli.png
import Tabs from '@theme/Tabs' import Tabs from '@theme/Tabs'
import TabItem from '@theme/TabItem' import TabItem from '@theme/TabItem'
Nhost CLI, or `nhost`, is a command-line interface that lets you run and manage Nhost apps locally on Mac, Linux and Windows (WSL2). Nhost CLI, or `nhost`, is a command-line interface that lets you run and manage Nhost projects locally on Mac, Linux and Windows (WSL2).
This means you get a full-featured Nhost app running locally on your machine: This means you get a full-featured Nhost project running locally on your machine:
- Postgres Database - Postgres Database
- Hasura GraphQL API - Hasura GraphQL API
@@ -55,41 +55,41 @@ Start by authenticating yourself to Nhost Cloud:
nhost login nhost login
``` ```
Once signed in, you can list all your Nhost apps using: Once signed in, you can list all your Nhost projects using:
``` ```
nhost list nhost list
``` ```
Let's start by initializing a remote Nhost app locally with the following command: Let's start by initializing a remote Nhost project locally with the following command:
``` ```
nhost init --remote nhost init --remote
``` ```
Pick a Nhost app to use then change the directory once the app initialization is completed: Pick a Nhost project to use then change the directory once the project initialization is completed:
``` ```
cd my_test_app cd my_test_app
``` ```
Then start the Nhost app locally: Then start the Nhost project locally:
``` ```
nhost up nhost up
``` ```
Hasura Console starts automatically and your Nhost app is running locally with the backend URL: `http://localhost:1337`. Hasura Console starts automatically and your Nhost project is running locally.
## Subdomain and Region ## Subdomain and Region
Use `localhost:1337` as the `subdomain`, and skip `region` when using the CLI and the [JavaScript SDK](/reference/javascript): Use `localhost` as the `subdomain`, and skip `region` when using the CLI and the [JavaScript SDK](/reference/javascript):
``` ```
import { NhostClient } from '@nhost/nhost-js' import { NhostClient } from '@nhost/nhost-js'
const nhost = new NhostClient({ const nhost = new NhostClient({
subdomain: 'localhost:1337', subdomain: 'localhost',
}) })
``` ```
@@ -97,12 +97,22 @@ const nhost = new NhostClient({
During local development with the CLI, all transactional emails from Authentication are sent to a local Mailhog instance, instead of to the recipient's email address. You'll see an address where after starting [`nhost up`](/reference/cli/up) where all emails are sent to. During local development with the CLI, all transactional emails from Authentication are sent to a local Mailhog instance, instead of to the recipient's email address. You'll see an address where after starting [`nhost up`](/reference/cli/up) where all emails are sent to.
For the example below, all emails are accessable at `http://localhost:8839`. For the example below, all emails are accessible at `http://localhost:8025`.
```bash ```bash
$ nhost up $ nhost up
✔ Your app is running at http://localhost:1337 (Ctrl+C to stop) URLs:
Emails will be sent to http://localhost:8839 - Postgres: postgres://postgres:postgres@localhost:5432/postgres
- GraphQL: http://localhost:1337/v1/graphql
- Auth: http://localhost:1337/v1/auth
- Storage: http://localhost:1337/v1/storage
- Functions: http://localhost:1337/v1/functions
- Hasura console: http://localhost:9695
- Mailhog: http://localhost:8025
- subdomain: localhost
- region: (empty)
``` ```
## What's next? ## What's next?

View File

@@ -7,7 +7,7 @@ image: /img/og/platform/database.png
import Tabs from '@theme/Tabs' import Tabs from '@theme/Tabs'
import TabItem from '@theme/TabItem' import TabItem from '@theme/TabItem'
Every Nhost app comes with its own [Postgres database](https://postgres.org/). Postgres is the world's most advanced open-source relational database and it's the most [popular SQL database for developers](https://insights.stackoverflow.com/survey/2021#section-most-loved-dreaded-and-wanted-databases). Every Nhost project comes with its own [Postgres database](https://postgres.org/). Postgres is the world's most advanced open-source relational database and it's the most [popular SQL database for developers](https://insights.stackoverflow.com/survey/2021#section-most-loved-dreaded-and-wanted-databases).
:::info :::info
@@ -34,7 +34,7 @@ Hasura Console is where you manage your database. This is where you create and m
The two schemas `auth` and `storage` are reserved for Nhost Auth and Nhost Storage to work. You're allowed to modify **permissions** and **add relationships**. However, never modify any tables or remove relationships that were added by Nhost inside the `auth` and `storage` schemas. The two schemas `auth` and `storage` are reserved for Nhost Auth and Nhost Storage to work. You're allowed to modify **permissions** and **add relationships**. However, never modify any tables or remove relationships that were added by Nhost inside the `auth` and `storage` schemas.
Generally, you should use the `public` schema when creating and managing your tables for your app. It's also ok to add custom schemas for more advanced usage. Generally, you should use the `public` schema when creating and managing your tables for your project. It's also ok to add custom schemas for more advanced usage.
## Create Table ## Create Table

View File

@@ -6,11 +6,11 @@ image: /img/og/platform/environment-variables.png
Environment Variables are key-value pairs configured outside your source code. They are used to store environment-specific values such as API keys. Environment Variables are key-value pairs configured outside your source code. They are used to store environment-specific values such as API keys.
You can manage your app's environment variables in Nhost Console under **Variables**. When you define a new variable, you can set one value for **production** and one for **development**. You can manage your project's Environment Variables in Nhost Dashboard under **Variables**. When you define a new variable, you can set one value for **production** and one for **development**.
![Environment Variables](/img/platform/environment-variables/environment-variables.png) ![Environment Variables](/img/platform/environment-variables/environment-variables.png)
When an environment variable is changed, you must deploy your app again using the [GitHub integration](/platform/github-integration) for the changes to take effect. When an Environment Variable is changed, you must deploy your project again using the [GitHub integration](/platform/github-integration) for the changes to take effect.
Environment Variables are available in: Environment Variables are available in:
@@ -19,7 +19,7 @@ Environment Variables are available in:
## System Environment Variables ## System Environment Variables
System environment variables are automatically available in production and during development. The following system environment variables are available: System Environment Variables are automatically available in production and during development. The following system Environment Variables are available:
- `NHOST_ADMIN_SECRET` - `NHOST_ADMIN_SECRET`
- `NHOST_WEBHOOK_SECRET` - `NHOST_WEBHOOK_SECRET`
@@ -38,7 +38,7 @@ NHOST_BACKEND_URL=https://xxxxxxx.nhost.run
## Development Environment Variables ## Development Environment Variables
When developing locally using the [CLI](/platform/cli), environment variables set in `.env.development` are available in your local environment. There are two ways to manage them: When developing locally using the [CLI](/platform/cli), Environment Variables set in `.env.development` are available in your local environment. There are two ways to manage them:
1. Edit the `.env.development` file manually. 1. Edit the `.env.development` file manually.
2. Add development environment variables in the Nhost Console and use `nhost env pull` to sync them. This way, your team members will also have access to the same variables. 2. Add development Environment Variables in the Nhost Dashboard and use `nhost env pull` to sync them. This way, your team members will also have access to the same Environment Variables.

View File

@@ -4,9 +4,9 @@ sidebar_position: 10
image: /img/og/platform/github-integration.png image: /img/og/platform/github-integration.png
--- ---
The GitHub integration allows you to automatically deploy your Nhost app when on push and merge to a GitHub repository that is connected to your Nhost app. The GitHub integration allows you to automatically deploy your Nhost project when on push and merge to a GitHub repository that is connected to your Nhost project.
When a GitHub repository is connected to a Nhost app, Nhost automatically deploys changes when you push code to the repo. When a GitHub repository is connected to a Nhost project, Nhost automatically deploys changes when you push code to the repo.
The following things are deployed: The following things are deployed:
@@ -20,11 +20,11 @@ Settings in `nhost/config.yaml` are **not** deployed. That means you need to man
## Connecting a GitHub repository ## Connecting a GitHub repository
1. From your Nhost app, click **Connect to Github**. 1. From your Nhost project, click **Connect to Github**.
![Connect to GitHub](/img/architecture/cli/connect-repo-step-1.png) ![Connect to GitHub](/img/architecture/cli/connect-repo-step-1.png)
2. **Install the Nhost app** on your Github account. 2. **Install the Nhost project** on your Github account.
![Install the Nhost GitHub App](/img/architecture/cli/connect-repo-step-2.png) ![Install the Nhost GitHub App](/img/architecture/cli/connect-repo-step-2.png)
@@ -36,9 +36,9 @@ Settings in `nhost/config.yaml` are **not** deployed. That means you need to man
Nhost only deploys your **deployment branch**. By default, your deployment branch matches the default branch set on GitHub (usually `main`). Nhost only deploys your **deployment branch**. By default, your deployment branch matches the default branch set on GitHub (usually `main`).
You can change the deployment branch by clicking **Edit** next to the repository in your Nhost app's dashboard. You can change the deployment branch by clicking **Edit** next to the repository in your Nhost project's Overview.
You can have multiple Nhost apps connected to the same GitHub repository and use different deployment branches (e.g., `main` and `staging`). You can have multiple Nhost projects connected to the same GitHub repository and use different deployment branches (e.g., `main` and `staging`).
<center> <center>
<img src="/img/platform/github-integration/deployment-branch.png" alt="drawing" width="50%" /> <img src="/img/platform/github-integration/deployment-branch.png" alt="drawing" width="50%" />
@@ -46,7 +46,7 @@ You can have multiple Nhost apps connected to the same GitHub repository and use
## Base Directory ## Base Directory
If your Nhost app is not at the root of your git repository, you can set a custom base directory. The base directory is where the `nhost` and `functions` directories are located. In other words, the base directory is the **parent directory** of the `nhost` and `functions` directories. If your Nhost project is not at the root of your git repository (typically when using a monorepo), you can set a custom base directory. The base directory is where the `nhost` directory is located. In other words, the base directory is the **parent directory** of the `nhost` folder.
<center> <center>
<img src="/img/platform/github-integration/base-directory.png" alt="drawing" width="50%" /> <img src="/img/platform/github-integration/base-directory.png" alt="drawing" width="50%" />
@@ -54,4 +54,4 @@ If your Nhost app is not at the root of your git repository, you can set a custo
## Next Steps ## Next Steps
- Learn how to [use the CLI to deploy your Nhost app](/platform/overview/get-started-with-nhost-cli). - Learn how to [use the CLI to deploy your Nhost project](/platform/overview/get-started-with-nhost-cli).

View File

@@ -6,7 +6,7 @@ image: /img/og/platform/graphql.png
A GraphQL API is automatically and instantly available based on the tables and columns in your [database](/platform/database). A GraphQL API is automatically and instantly available based on the tables and columns in your [database](/platform/database).
The GraphQL API has instant support for inserting, selecting, updating, and deleting data, which usually account for 80% of all operations you need in your app. The GraphQL API has instant support for inserting, selecting, updating, and deleting data, which usually account for 80% of all API operations you need.
It's the [Hasura GraphQL engine](https://github.com/hasura/graphql-engine) that powers the GraphQL API which means that all documentation about [queries](https://hasura.io/docs/latest/graphql/core/databases/postgres/queries/index/), [mutations](https://hasura.io/docs/latest/graphql/core/databases/postgres/mutations/index/), and [subscriptions](https://hasura.io/docs/latest/graphql/core/databases/postgres/subscriptions/index/) from Hasura's documentation is applicable. It's the [Hasura GraphQL engine](https://github.com/hasura/graphql-engine) that powers the GraphQL API which means that all documentation about [queries](https://hasura.io/docs/latest/graphql/core/databases/postgres/queries/index/), [mutations](https://hasura.io/docs/latest/graphql/core/databases/postgres/mutations/index/), and [subscriptions](https://hasura.io/docs/latest/graphql/core/databases/postgres/subscriptions/index/) from Hasura's documentation is applicable.
@@ -40,7 +40,7 @@ When building more complex frontend applications, we recommend using a more adva
A GraphQL query is used to fetch data from the database. A GraphQL query is used to fetch data from the database.
:::tip :::tip
The [Queries documentation from Hasura](https://hasura.io/docs/latest/graphql/core/databases/postgres/queries/index/) is applicable since Nhost uses Hasura's GraphQL Engine for your app. The [Queries documentation from Hasura](https://hasura.io/docs/latest/graphql/core/databases/postgres/queries/index/) is applicable since we're using Hasura's GraphQL Engine for your project.
::: :::
**Example:** A GraphQL query to select `title`, `body`, and `isCompleted` for every row in the `todos` table. **Example:** A GraphQL query to select `title`, `body`, and `isCompleted` for every row in the `todos` table.
@@ -131,7 +131,7 @@ query GetTodosWithLatestComments {
A GraphQL mutation is used to insert, upsert, update, or delete data. A GraphQL mutation is used to insert, upsert, update, or delete data.
:::tip :::tip
The [Mutations documentation from Hasura](https://hasura.io/docs/latest/graphql/core/databases/postgres/mutations/index/) is applicable since Nhost uses Hasura's GraphQL Engine for your app. The [Mutations documentation from Hasura](https://hasura.io/docs/latest/graphql/core/databases/postgres/mutations/index/) is applicable since we're using Hasura's GraphQL Engine for your project.
::: :::
### Insert Data ### Insert Data

View File

@@ -32,7 +32,7 @@ The rule above make it so users can only select posts where the value of `user_i
`x-hasura-user-id` is a permission variable that is used to create permission rules in Hasura. The permission variable comes from the [access token](platform/authentication#access-tokens) that signed-in users have. `x-hasura-user-id` is a permission variable that is used to create permission rules in Hasura. The permission variable comes from the [access token](platform/authentication#access-tokens) that signed-in users have.
The `x-hasura-user-id` permission variable is always available for all signed-in users. You can add [custom permission variables](#custom-permission-variables) to create more complex permission rules unique to your app. The `x-hasura-user-id` permission variable is always available for all signed-in users. You can add [custom permission variables](#custom-permission-variables) to create more complex permission rules unique to your project.
## Custom Permission Variables ## Custom Permission Variables

View File

@@ -99,11 +99,11 @@ nhost logout
## Set up your project ## Set up your project
### 1. Create a new Nhost app ### 1. Create a new Nhost project
import CreateApp from '@site/src/components/create-nhost-app.mdx'; import CreateProject from '@site/src/components/create-nhost-project.mdx'
<CreateApp /> <CreateProject />
### 2. Create a new GitHub Repository ### 2. Create a new GitHub Repository
@@ -119,61 +119,43 @@ either public or private.
### 3. Connect Nhost project to Github ### 3. Connect Nhost project to Github
Finally, connect your Github repository to your Nhost project. Doing so will Finally, connect your GitHub repository to your Nhost project. Doing so will
enable Nhost to deploy new versions of your project when you push automatically enable Nhost to deploy new versions of your project when you push new commits to your connected Git repository.
commits to your connected Git repository.
1. From your project workspace, click **Connect to Github**. 1. From your project workspace, click **Connect to GitHub**.
![Connect to GitHub](/img/architecture/cli/connect-repo-step-1.png) ![Connect to GitHub](/img/architecture/cli/connect-repo-step-1.png)
2. **Install the Nhost app** on your Github account. 2. **Install the Nhost app** on your GitHub account.
![Connect to GitHub](/img/architecture/cli/connect-repo-step-2.png) ![Connect to GitHub](/img/architecture/cli/connect-repo-step-2.png)
3. **Connect** your Github repository. 3. **Connect** your GitHub repository.
![Connect to GitHub](/img/architecture/cli/connect-repo-step-3.png) ![Connect to GitHub](/img/architecture/cli/connect-repo-step-3.png)
## Develop locally ## Develop locally
## 1. Initialize your Nhost app ## 1. Initialize your Nhost project
**Nhost CLI** brings the functionality of your Nhost production environment **Nhost CLI** brings the functionality of your Nhost production environment
directly to your local machine. directly to your local machine.
It provides Docker containers to run the backend services that match your It provides Docker containers to run the backend services that match your
production application in a local environment. That way, you can make changes production environment in a local environment. That way, you can make changes
and test your code locally before deploying those changes to production. and test your code locally before deploying those changes to production.
You can either initialize a blank Nhost app locally to start from scratch by Initialize your Nhost project locally with the following command:
running the following command:
```bash ```bash
nhost init -n my-nhost-app nhost init --remote
``` ```
And then link it to a remote app from your Nhost workspace in `app.nhost.io` by It will prompt you to choose what Nhost project you want to initialize.
running the `link` command and selecting the corresponding app from the prompt:
```bash ![Select Nhost Project](/img/architecture/cli/cli-select-app.png)
nhost link
```
Or you can directly initialize a local Nhost app from one of your existing Your file system will be populated with the following files and folders:
production apps by specifying the `--remote` flag:
```bash
nhost init --remote -n my-nhost-app
```
It will also prompt you to choose the remote app you'd like to use to initialize
your local Nhost development environment.
![Select app](/img/architecture/cli/cli-select-app.png)
The `init` command creates the Nhost app inside your current working directory
within a `nhost/` folder.
``` ```
my-nhost-app/ my-nhost-app/
@@ -200,11 +182,11 @@ git push -u origin main
## 2. Start a local development environment ## 2. Start a local development environment
To start a local development environment for your Nhost app, run the following To start a local development environment for your Nhost project, run the following
command: command:
```bash ```bash
nhost dev nhost up
``` ```
:::caution :::caution
@@ -213,11 +195,10 @@ Make sure [Docker](https://www.docker.com/get-started) is up and running. Its
Running this command will start up all the backend services provided by Nhost. Running this command will start up all the backend services provided by Nhost.
It also runs a webserver to serve the Hasura console for the GraphQL engine so It also runs a webserver to serve the Hasura Console for the GraphQL Engine so
you can manage the database and try out the API. you can manage the database and test the GraphQL API.
The Hasura console should open automatically at The Hasura Console opens automatically at [http://localhost:9695](http://localhost:9695/).
[http://localhost:1337](http://localhost:1337/).
![Hasura Console](/img/architecture/cli/hasura-console.png) ![Hasura Console](/img/architecture/cli/hasura-console.png)
@@ -226,7 +207,7 @@ The Hasura console should open automatically at
There are three things the Nhost CLI and the GitHub integration track and apply There are three things the Nhost CLI and the GitHub integration track and apply
to production: to production:
- Database migrations - Database Migrations
- Hasura Metadata - Hasura Metadata
- Serverless Functions - Serverless Functions
@@ -239,7 +220,7 @@ Settings in `nhost/config.yaml` are not being applied to production. They only w
Database changes are tracked and managed through migrations. Database changes are tracked and managed through migrations.
:::tip :::tip
It's important that you use the Hasura console to make database changes. Indeed, with the Hasura console, DB migration files are generated incrementally to track changes automatically for you. You must use the Hasura Console to make database changes. With the Hasura Console, database migration files are automatically generated incrementally to track database changes for you.
::: :::
To demonstrate how to make database changes, let's create a new table called To demonstrate how to make database changes, let's create a new table called
@@ -250,14 +231,15 @@ To demonstrate how to make database changes, let's create a new table called
- `authorId` (type UUID), - `authorId` (type UUID),
- `createdAt` (type Timestamp and default `now()`) - `createdAt` (type Timestamp and default `now()`)
In the Hasura console, head over to the **data** tab section and click on the In the Hasura Console, go to the **DATA** tab section and click on the
PostgreSQL database (from the left side navigation) that Nhost provides us. PostgreSQL database (from the left side navigation) that Nhost provides us.
Click on the **public** schema and the **Create Table** button. Click on the **public** schema and then the **Create Table** button.
![Create Table](/img/architecture/cli/create-table-step-1.png) ![Create Table](/img/architecture/cli/create-table-step-1.png)
Then, enter the values for creating the `messages` table as mentioned above. Enter the values for creating the `messages` table as mentioned above.
Also, specify the `id` column as the primary key of the table, and link the Also, specify the `id` column as the primary key of the table, and link the
`authorId` column to the `users.id` column using a foreign key to link the `authorId` column to the `users.id` column using a foreign key to link the
`users` and `messages` tables together. `users` and `messages` tables together.
@@ -280,7 +262,7 @@ drwxr-xr-x 3 user staff 96 Apr 27 17:06 ..
drwxr-xr-x 4 user staff 128 Apr 27 17:06 1651071963431_create_table_public_messages drwxr-xr-x 4 user staff 128 Apr 27 17:06 1651071963431_create_table_public_messages
``` ```
However, note that this database migration has only been applied locally. In Note that this database migration has only been applied locally. In
other words, the `messages` table does not (yet) exists in production. other words, the `messages` table does not (yet) exists in production.
To apply the local changes to production, check out the To apply the local changes to production, check out the
@@ -338,12 +320,12 @@ insert_permissions:
role: user role: user
``` ```
### Serverless functions ### Serverless Functions
Now let's create a serverless function before we push all changes to GitHub so Now let's create a Serverless Function before we push all changes to GitHub so
Nhost can deploy them to production. Nhost can deploy them to production.
For this guide, let's create a simple serverless function that will return the For this guide, let's create a Serverless Function that will return the
current date-time when called. current date-time when called.
First, make sure to install `express`, which is required for serverless First, make sure to install `express`, which is required for serverless

View File

@@ -11,7 +11,7 @@ import TabItem from '@theme/TabItem'
## Introduction ## Introduction
This quickstart guide provides the steps you need to build a simple Next.js app This quickstart provides the steps you need to build a Next.js app
powered by Nhost for the backend. It includes: powered by Nhost for the backend. It includes:
- Database: [PostgreSQL](https://www.postgresql.org/) - Database: [PostgreSQL](https://www.postgresql.org/)
@@ -19,7 +19,7 @@ powered by Nhost for the backend. It includes:
- Authentication: [Hasura Auth](https://github.com/nhost/hasura-auth/) - Authentication: [Hasura Auth](https://github.com/nhost/hasura-auth/)
- Storage: [Hasura Storage](https://hub.docker.com/r/nhost/hasura-storage) - Storage: [Hasura Storage](https://hub.docker.com/r/nhost/hasura-storage)
By the end of this guide, you'll have a full-stack app that allows users to log By the end of this guide, you'll have a full-stack app that allows users to sign
in to access a protected dashboard and update their profile information. in to access a protected dashboard and update their profile information.
## Prerequisites ## Prerequisites
@@ -33,12 +33,12 @@ You'll need **Node.js** version 12 or later: [install it from here](https://node
### Create a new Nhost app ### Create a new Nhost app
import CreateApp from '@site/src/components/create-nhost-app.mdx' import CreateApp from '@site/src/components/create-nhost-project.mdx'
<CreateApp /> <CreateApp />
:::info :::info
You can also connect your Nhost app to a GitHub repository. When you do this, any updates you push to your code will automatically be deployed. [Learn more](https://docs.nhost.io/platform/github-integration). You can also connect your Nhost project to a GitHub repository. When you do this, any updates you push to your code will automatically be deployed. [Learn more](https://docs.nhost.io/platform/github-integration).
::: :::
## Initialize the app ## Initialize the app
@@ -153,13 +153,13 @@ function MyApp({ Component, pageProps }) {
Finally, store the environment variables for `subdomain` and `region` in `.env.development`: Finally, store the environment variables for `subdomain` and `region` in `.env.development`:
```yaml title=".env.development" ```yaml title=".env.development"
NEXT_PUBLIC_NHOST_SUBDOMAIN=YOUR_NHOST_APP_SUBDOMAIN NEXT_PUBLIC_NHOST_SUBDOMAIN=[subdomain]
NEXT_PUBLIC_NHOST_REGION=YOUR_NHOST_APP_REGION NEXT_PUBLIC_NHOST_REGION=[region]
``` ```
You find your Nhost app's subdomain and region in [the app dashboard](https://app.nhost.io): You find your Nhost project's `subdomain` and `region` in the [project overview](https://app.nhost.io):
![Nhost App Dashboard](/img/quickstarts/app-dashboard.png) ![Project Overview](/img/quickstarts/app-dashboard.png)
:::caution :::caution
Don't forget to restart your Next.js server after saving your `.env.development` Don't forget to restart your Next.js server after saving your `.env.development`

View File

@@ -31,14 +31,14 @@ You'll need **Node.js** version 14 or later: [install it from here](https://node
## Project setup ## Project setup
### Create a new Nhost app ### Create a new Nhost project
import CreateApp from '@site/src/components/create-nhost-app.mdx' import CreateProject from '@site/src/components/create-nhost-project.mdx'
<CreateApp /> <CreateProject />
:::info :::info
You can also connect your Nhost app to a GitHub repository. When you do this, any updates you push to your code will automatically be deployed. [Learn more](https://docs.nhost.io/platform/github-integration). You can also connect your Nhost project to a GitHub repository. When you do this, any updates you push to your code will automatically be deployed. [Learn more](https://docs.nhost.io/platform/github-integration).
::: :::
## Initialize the app ## Initialize the app
@@ -147,13 +147,13 @@ Finally, make sure to create an environment variable named
`REACT_APP_NHOST_SUBDOMAIN` and `REACT_APP_NHOST_REGION` to store your Nhost domain details: `REACT_APP_NHOST_SUBDOMAIN` and `REACT_APP_NHOST_REGION` to store your Nhost domain details:
```yaml title=".env.local" ```yaml title=".env.local"
REACT_APP_NHOST_SUBDOMAIN=YOUR_NHOST_APP_SUBDOMAIN REACT_APP_NHOST_SUBDOMAIN=[subdomain]
REACT_APP_NHOST_REGION=YOUR_NHOST_APP_REGION REACT_APP_NHOST_REGION=[region]
``` ```
You find your Nhost app's subdomain and region in [the app dashboard](https://app.nhost.io): You find your Nhost project's `subdomain` and `region` in the [project overview](https://app.nhost.io):
![Nhost App Dashboard](/img/quickstarts/app-dashboard.png) ![Project Overview](/img/quickstarts/app-dashboard.png)
:::caution :::caution
Don't forget to restart your React server after saving your `.env.local` Don't forget to restart your React server after saving your `.env.local`

View File

@@ -44,27 +44,16 @@ If your system versions do not meet both requirements, the RedwoodJS installatio
### Create a new Nhost app ### Create a new Nhost app
First things first, we need to create a new Nhost project. import CreateApp from '@site/src/components/create-nhost-project.mdx'
So, log in to your Nhost dashboard and click the **Create your first app** <CreateApp />
button.
![nhost-first-app](/img/quickstarts/create-app-step-1.png)
Next, give your new Nhost app a name, select a geographic region for your Nhost
services and click **Create App**.
![nhost-first-app](/img/quickstarts/create-app-step-2.png)
After a few seconds, you should get a PostgreSQL database, a GraphQL API with
Hasura, file storage, and authentication set up.
Finally, update your client login URL from your Nhost dashboard as the local RedwoodJS server starts on port `8910` instead of the usual `3000` port you may be used to with a regular React app. Finally, update your client login URL from your Nhost dashboard as the local RedwoodJS server starts on port `8910` instead of the usual `3000` port you may be used to with a regular React app.
![nhost-first-app](/img/quickstarts/create-app-step-3.png) ![nhost-first-app](/img/quickstarts/create-app-step-3.png)
:::info :::info
You can also connect your Nhost app to a GitHub repository. When you do this, any updates you push to your code will automatically be deployed. [Learn more](https://docs.nhost.io/platform/github-integration). You can also connect your Nhost project to a GitHub repository. When you do this, any updates you push to your code will automatically be deployed. [Learn more](https://docs.nhost.io/platform/github-integration).
::: :::
## Initialize the app ## Initialize the app
@@ -179,13 +168,13 @@ That prop avoids having an additional request to fetch the current user.
Next, store the environment variables for `subdomain` and `region` in `.env`: Next, store the environment variables for `subdomain` and `region` in `.env`:
```yaml title=".env" ```yaml title=".env"
NHOST_SUBDOMAIN=YOUR_NHOST_APP_SUBDOMAIN NHOST_SUBDOMAIN=[subdomain]
NHOST_REGION=YOUR_NHOST_APP_REGION NHOST_REGION=[region]
``` ```
You find your Nhost app's subdomain and region in [the app dashboard](https://app.nhost.io): You find your Nhost project's `subdomain` and `region` in the [project overview](https://app.nhost.io):
![Nhost App Dashboard](/img/quickstarts/app-dashboard.png) ![Project Overview](/img/quickstarts/app-dashboard.png)
Finally, we need to customize the GraphQL Endpoint for our RedwoodJS app. Indeed, by default, RedwoodJS provides a built-in GraphQL server under the `api` side. However, as we already have our own GraphQL server through Nhost and Hasura, we do not need it. Finally, we need to customize the GraphQL Endpoint for our RedwoodJS app. Indeed, by default, RedwoodJS provides a built-in GraphQL server under the `api` side. However, as we already have our own GraphQL server through Nhost and Hasura, we do not need it.

View File

@@ -39,12 +39,12 @@ You'll need **Node.js** version 14 or later: [install it from here](https://node
### Create a new Nhost app ### Create a new Nhost app
import CreateApp from '@site/src/components/create-nhost-app.mdx' import CreateApp from '@site/src/components/create-nhost-project.mdx'
<CreateApp /> <CreateApp />
:::info :::info
You can also connect your Nhost app to a GitHub repository. When you do this, any updates you push to your code will automatically be deployed. [Learn more](https://docs.nhost.io/platform/github-integration). You can also connect your Nhost project to a GitHub repository. When you do this, any updates you push to your code will automatically be deployed. [Learn more](https://docs.nhost.io/platform/github-integration).
::: :::
## Initialize the app ## Initialize the app
@@ -174,13 +174,13 @@ app.mount('#app')
Finally, store the environment variables for `subdomain` and `region` in `.env`: Finally, store the environment variables for `subdomain` and `region` in `.env`:
```yaml title=".env.development" ```yaml title=".env.development"
VITE_NHOST_SUBDOMAIN=YOUR_NHOST_APP_SUBDOMAIN VITE_NHOST_SUBDOMAIN=[subdomain]
VITE_NHOST_REGION=YOUR_NHOST_APP_REGION VITE_NHOST_REGION=[region]
``` ```
You find your Nhost app's subdomain and region in [the app dashboard](https://app.nhost.io): You find your Nhost project's `subdomain` and `region` in the [project overview](https://app.nhost.io):
![Nhost App Dashboard](/img/quickstarts/app-dashboard.png) ![Project Overview](/img/quickstarts/app-dashboard.png)
## Build the app ## Build the app

View File

@@ -15,7 +15,7 @@ Serverless functions can be used to handle [event triggers](/platform/database/e
## Creating a Serverless Function ## Creating a Serverless Function
Every `.js` (JavaScript) and `.ts` (TypeScript) file in the `functions/` folder of your Nhost app is its own serverless function. Every `.js` (JavaScript) and `.ts` (TypeScript) file in the `functions/` folder of your Nhost project is its own serverless function.
<Tabs groupId="language"> <Tabs groupId="language">
<TabItem value="ts" label="TypeScript" default> <TabItem value="ts" label="TypeScript" default>
@@ -30,7 +30,7 @@ export default (req: Request, res: Response) => {
:::info :::info
You **MUST** install `express` locally in the base directory of your Nhost app. You **MUST** install `express` locally in the base directory of your Nhost project.
```bash ```bash
npm install -d express @types/express npm install -d express @types/express
@@ -51,7 +51,7 @@ export default (req, res) => {
:::info :::info
You **MUST** install `express` locally in the base directory of your Nhost app. You **MUST** install `express` locally in the base directory of your Nhost project.
```bash ```bash
npm install -d express npm install -d express
@@ -76,12 +76,12 @@ HTTP endpoints are automatically generated based on the file structure inside `f
Here's an example of four serverless functions with their files and their HTTP endpoints: Here's an example of four serverless functions with their files and their HTTP endpoints:
| File | HTTP Endpoint | | File | HTTP Endpoint |
| --------------------------- | ------------------------------------------------------------- | | --------------------------- | ----------------------------------------------------------------- |
| `functions/index.js` | `https://[app-subdomain].nhost.run/v1/functions/` | | `functions/index.js` | `https://[project-subdomain].nhost.run/v1/functions/` |
| `functions/users/index.ts` | `https://[app-subdomain].nhost.run/v1/functions/users` | | `functions/users/index.ts` | `https://[project-subdomain].nhost.run/v1/functions/users` |
| `functions/users/active.ts` | `https://[app-subdomain].nhost.run/v1/functions/users/active` | | `functions/users/active.ts` | `https://[project-subdomain].nhost.run/v1/functions/users/active` |
| `functions/my-company.js` | `https://[app-subdomain].nhost.run/v1/functions/my-company` | | `functions/my-company.js` | `https://[project-subdomain].nhost.run/v1/functions/my-company` |
--- ---
@@ -103,4 +103,4 @@ All serverless functions in production are running Node.js version 14.x.
## Regions ## Regions
Serverless Functions are always deployed to the same region as your app. Serverless Functions are always deployed to the same region as your project.

View File

@@ -20,7 +20,7 @@ File metadata is stored in your database in the `files` table in the `storage` s
- Create GraphQL relationships between files and your database tables. - Create GraphQL relationships between files and your database tables.
:::warning :::warning
Don't modify the database schema, nor GraphQL root fields in any of the tables in the `storage` schema. Don't modify the database schema, nor GraphQL root fields in any of the tables in the `storage` schema.
::: :::
:::tip :::tip
@@ -28,8 +28,8 @@ You're allowed to add and modify the following:
- GraphQL Relationships - GraphQL Relationships
- Permissions - Permissions
:::
:::
### Upload File ### Upload File
@@ -159,16 +159,11 @@ Permissions to upload, download, and delete files are managed through Hasura's p
### Upload ### Upload
To upload a file, a user must have the **`insert` permission** to the `storage.files` table. The following columns must be allowed to insert: To upload a file, a user must have the **`insert` permission** to the `storage.files` table. The `id` column must be granted.
- `id`
- `bucket_id`
- `name`
- `mime_type`
### Download ### Download
To download a file, a user must have the **`select` permission** to the `storage.files` table. Only the `id` column is required, but we recommend allowing to select all columns. To download a file, a user must have the **`select` permission** to the `storage.files` table. **All** columns must be granted.
### Delete ### Delete
@@ -200,31 +195,35 @@ Let's say you want to build a CRM system and you want to store files for custome
Start with, you would have two tables: Start with, you would have two tables:
1. `customers` - Customer data. 1. `customers` - Customer data.
2. `customer_files` - What file belongs to what customer. 2. `customer_files` - What file belongs to what customer
```text ```text
- customers - customers
- id - id
- name - name
- address - address
customer_files customer_files
- id - id
- customer_id (Foreign Key to `customers.id`) - customer_id (Foreign Key to `customers.id`)
- file_id (Foreign Key to `storage.files.id`) - file_id (Foreign Key to `storage.files.id`)
``` ```
You would also create [Hasura Relationships](https://hasura.io/docs/latest/graphql/core/databases/postgres/schema/table-relationships/index/) (GraphQL relationships) between between `customers` and `customer_files` and between `customer_files` and `storage.files`. You would also create a [Hasura Relationship](https://hasura.io/docs/latest/graphql/core/databases/postgres/schema/table-relationships/index/) (GraphQL relationship) between between `customers` and `customer_files` and between `customer_files` and `storage.files`.
With the two tables and GraphQL relationships in place, you can query customers and the customer's files like this: With the two tables and GraphQL relationships in place, you can query customers and the customer's files like this:
```graphql ```graphql
query { query {
customers { # customers table customers {
# customers table
id id
name name
customer_files { # customer_files tabel customer_files {
# customer_files table
id id
file { # storage.files table file {
# storage.files table
id id
name name
size size
@@ -239,6 +238,6 @@ The file upload process would be as follows:
1. Upload a file. 1. Upload a file.
2. Get the returned file id. 2. Get the returned file id.
3. Insert the file `id` and the customer's `id` into the `customer_files` table. 3. Insert (GraphQL Mutation) the file `id` and the customer's `id` into the `customer_files` table.
This would allow you to upload and download files belonging to specific customers in your CRM system. This would allow you to upload and download files belonging to specific customers in your CRM system.

View File

@@ -3,15 +3,15 @@ title: 'init'
sidebar_position: 1 sidebar_position: 1
--- ---
Intialize a local Nhost app in the current working directory. Intialize a local Nhost project in the current working directory.
``` ```
nhost init nhost init
``` ```
If you already have a Nhost app in Nhost Cloud you can use that app as a starting point by appending `--remote` to the command. If you already have a Nhost project in Nhost Cloud you can use that project as a starting point by appending `--remote` to the command.
This will pull the database migrations and Hasura metadata from the Nhost Cloud app locally for you to use as a starting point. This will pull the database migrations and Hasura metadata from the Nhost Cloud project locally for you to use as a starting point.
``` ```
nhost init --remote nhost init --remote

View File

@@ -3,7 +3,7 @@ title: 'link'
sidebar_position: 4 sidebar_position: 4
--- ---
Link the local Nhost app in your working directory to an app in Nhost Cloud. Link the local Nhost project in your working directory to a project in Nhost Cloud.
```bash ```bash
nhost link nhost link

View File

@@ -3,7 +3,7 @@ title: 'list'
sidebar_position: 7 sidebar_position: 7
--- ---
List all your Nhost apps in Nhost Cloud. List all your Nhost projects in Nhost Cloud.
```bash ```bash
nhost list nhost list

View File

@@ -3,7 +3,7 @@ title: 'up'
sidebar_position: 2 sidebar_position: 2
--- ---
Launch the development environment for your app. Once the environment is up, the command will: Launch the development environment for your project. Once the environment is up, the command will:
- Apply database migrations. - Apply database migrations.
- Apply the Hasura metadata. - Apply the Hasura metadata.

View File

@@ -4,7 +4,7 @@ title: signUp()
sidebar_label: signUp() sidebar_label: signUp()
slug: /reference/javascript/auth/sign-up slug: /reference/javascript/auth/sign-up
description: Use `nhost.auth.signUp` to sign up a user using email and password. If you want to sign up a user using passwordless email (Magic Link), SMS, or an OAuth provider, use the `signIn` function instead. description: Use `nhost.auth.signUp` to sign up a user using email and password. If you want to sign up a user using passwordless email (Magic Link), SMS, or an OAuth provider, use the `signIn` function instead.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L103 custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L102
--- ---
# `signUp()` # `signUp()`

View File

@@ -4,7 +4,7 @@ title: signIn()
sidebar_label: signIn() sidebar_label: signIn()
slug: /reference/javascript/auth/sign-in slug: /reference/javascript/auth/sign-in
description: Use `nhost.auth.signIn` to sign in a user using email and password, passwordless (email or sms) or an external provider. `signIn` can be used to sign in a user in various ways depending on the parameters. description: Use `nhost.auth.signIn` to sign in a user using email and password, passwordless (email or sms) or an external provider. `signIn` can be used to sign in a user in various ways depending on the parameters.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L146 custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L145
--- ---
# `signIn()` # `signIn()`
@@ -53,8 +53,8 @@ nhost.auth.signIn({ email: 'joe@example.com' })
```ts ```ts
// [step 1/2] Passwordless sign in using SMS // [step 1/2] Passwordless sign in using SMS
nhost.auth.signIn({ phoneNumber: '001122334455' }) nhost.auth.signIn({ phoneNumber: '+11233213123' })
// [step 2/2] Finish passwordless sign in using SMS (OTP) // [step 2/2] Finish passwordless sign in using SMS (OTP)
nhost.auth.signIn({ phoneNumber: '001122334455', otp: '123456' }) nhost.auth.signIn({ phoneNumber: '+11233213123', otp: '123456' })
``` ```

View File

@@ -4,7 +4,7 @@ title: signOut()
sidebar_label: signOut() sidebar_label: signOut()
slug: /reference/javascript/auth/sign-out slug: /reference/javascript/auth/sign-out
description: Use `nhost.auth.signOut` to sign out the user. description: Use `nhost.auth.signOut` to sign out the user.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L231 custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L233
--- ---
# `signOut()` # `signOut()`

View File

@@ -4,7 +4,7 @@ title: resetPassword()
sidebar_label: resetPassword() sidebar_label: resetPassword()
slug: /reference/javascript/auth/reset-password slug: /reference/javascript/auth/reset-password
description: Use `nhost.auth.resetPassword` to reset the password for a user. This will send a reset-password link in an email to the user. When the user clicks the reset-password link the user is automatically signed-in. Once signed-in, the user can change their password using `nhost.auth.changePassword()`. description: Use `nhost.auth.resetPassword` to reset the password for a user. This will send a reset-password link in an email to the user. When the user clicks the reset-password link the user is automatically signed-in. Once signed-in, the user can change their password using `nhost.auth.changePassword()`.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L247 custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L249
--- ---
# `resetPassword()` # `resetPassword()`

View File

@@ -3,13 +3,13 @@
title: changePassword() title: changePassword()
sidebar_label: changePassword() sidebar_label: changePassword()
slug: /reference/javascript/auth/change-password slug: /reference/javascript/auth/change-password
description: Use `nhost.auth.changePassword` to change the password for the user. The old password is not needed. description: Use `nhost.auth.changePassword` to change the password for the signed-in user. The old password is not needed. In case the user is not signed-in, a password reset ticket needs to be provided.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L263 custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L265
--- ---
# `changePassword()` # `changePassword()`
Use `nhost.auth.changePassword` to change the password for the user. The old password is not needed. Use `nhost.auth.changePassword` to change the password for the signed-in user. The old password is not needed. In case the user is not signed-in, a password reset ticket needs to be provided.
```ts ```ts
nhost.auth.changePassword({ newPassword: 'new-secret-password' }) nhost.auth.changePassword({ newPassword: 'new-secret-password' })
@@ -24,5 +24,6 @@ nhost.auth.changePassword({ newPassword: 'new-secret-password' })
| Property | Type | Required | Notes | | Property | Type | Required | Notes |
| :---------------------------------------------------------------------------------------------------------- | :------- | :------: | :---- | | :---------------------------------------------------------------------------------------------------------- | :------- | :------: | :---- |
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>newPassword</span> | `string` | ✔️ | | | <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>newPassword</span> | `string` | ✔️ | |
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>ticket</span> | `string` | | |
--- ---

View File

@@ -4,7 +4,7 @@ title: sendVerificationEmail()
sidebar_label: sendVerificationEmail() sidebar_label: sendVerificationEmail()
slug: /reference/javascript/auth/send-verification-email slug: /reference/javascript/auth/send-verification-email
description: Use `nhost.auth.sendVerificationEmail` to send a verification email to the specified email. The email contains a verification-email link. When the user clicks the verification-email link their email is verified. description: Use `nhost.auth.sendVerificationEmail` to send a verification email to the specified email. The email contains a verification-email link. When the user clicks the verification-email link their email is verified.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L279 custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L284
--- ---
# `sendVerificationEmail()` # `sendVerificationEmail()`

View File

@@ -4,7 +4,7 @@ title: changeEmail()
sidebar_label: changeEmail() sidebar_label: changeEmail()
slug: /reference/javascript/auth/change-email slug: /reference/javascript/auth/change-email
description: Use `nhost.auth.changeEmail` to change a user's email. This will send a confirm-email-change link in an email to the new email. Once the user clicks on the confirm-email-change link the email will be change to the new email. description: Use `nhost.auth.changeEmail` to change a user's email. This will send a confirm-email-change link in an email to the new email. Once the user clicks on the confirm-email-change link the email will be change to the new email.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L298 custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L303
--- ---
# `changeEmail()` # `changeEmail()`

View File

@@ -4,7 +4,7 @@ title: deanonymize()
sidebar_label: deanonymize() sidebar_label: deanonymize()
slug: /reference/javascript/auth/deanonymize slug: /reference/javascript/auth/deanonymize
description: Use `nhost.auth.deanonymize` to deanonymize a user. description: Use `nhost.auth.deanonymize` to deanonymize a user.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L314 custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L319
--- ---
# `deanonymize()` # `deanonymize()`

View File

@@ -4,7 +4,7 @@ title: onTokenChanged()
sidebar_label: onTokenChanged() sidebar_label: onTokenChanged()
slug: /reference/javascript/auth/on-token-changed slug: /reference/javascript/auth/on-token-changed
description: Use `nhost.auth.onTokenChanged` to add a custom function that runs every time the access or refresh token is changed. description: Use `nhost.auth.onTokenChanged` to add a custom function that runs every time the access or refresh token is changed.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L357 custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L362
--- ---
# `onTokenChanged()` # `onTokenChanged()`

View File

@@ -4,7 +4,7 @@ title: onAuthStateChanged()
sidebar_label: onAuthStateChanged() sidebar_label: onAuthStateChanged()
slug: /reference/javascript/auth/on-auth-state-changed slug: /reference/javascript/auth/on-auth-state-changed
description: Use `nhost.auth.onAuthStateChanged` to add a custom function that runs every time the authentication status of the user changes. E.g. add a custom function that runs every time the authentication status changes from signed-in to signed-out. description: Use `nhost.auth.onAuthStateChanged` to add a custom function that runs every time the authentication status of the user changes. E.g. add a custom function that runs every time the authentication status changes from signed-in to signed-out.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L392 custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L397
--- ---
# `onAuthStateChanged()` # `onAuthStateChanged()`

View File

@@ -4,7 +4,7 @@ title: isAuthenticated()
sidebar_label: isAuthenticated() sidebar_label: isAuthenticated()
slug: /reference/javascript/auth/is-authenticated slug: /reference/javascript/auth/is-authenticated
description: Use `nhost.auth.isAuthenticated` to check if the user is authenticated or not. description: Use `nhost.auth.isAuthenticated` to check if the user is authenticated or not.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L434 custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L439
--- ---
# `isAuthenticated()` # `isAuthenticated()`

View File

@@ -4,7 +4,7 @@ title: isAuthenticatedAsync()
sidebar_label: isAuthenticatedAsync() sidebar_label: isAuthenticatedAsync()
slug: /reference/javascript/auth/is-authenticated-async slug: /reference/javascript/auth/is-authenticated-async
description: Use `nhost.auth.isAuthenticatedAsync` to wait (await) for any internal authentication network requests to finish and then return the authentication status. description: Use `nhost.auth.isAuthenticatedAsync` to wait (await) for any internal authentication network requests to finish and then return the authentication status.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L452 custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L457
--- ---
# `isAuthenticatedAsync()` # `isAuthenticatedAsync()`

View File

@@ -4,7 +4,7 @@ title: getAuthenticationStatus()
sidebar_label: getAuthenticationStatus() sidebar_label: getAuthenticationStatus()
slug: /reference/javascript/auth/get-authentication-status slug: /reference/javascript/auth/get-authentication-status
description: Use `nhost.auth.getAuthenticationStatus` to get the authentication status of the user. description: Use `nhost.auth.getAuthenticationStatus` to get the authentication status of the user.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L478 custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L483
--- ---
# `getAuthenticationStatus()` # `getAuthenticationStatus()`

View File

@@ -4,7 +4,7 @@ title: getAccessToken()
sidebar_label: getAccessToken() sidebar_label: getAccessToken()
slug: /reference/javascript/auth/get-access-token slug: /reference/javascript/auth/get-access-token
description: Use `nhost.auth.getAccessToken` to get the access token of the user. description: Use `nhost.auth.getAccessToken` to get the access token of the user.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L508 custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L513
--- ---
# `getAccessToken()` # `getAccessToken()`

View File

@@ -4,7 +4,7 @@ title: getDecodedAccessToken()
sidebar_label: getDecodedAccessToken() sidebar_label: getDecodedAccessToken()
slug: /reference/javascript/auth/get-decoded-access-token slug: /reference/javascript/auth/get-decoded-access-token
description: Use `nhost.auth.getDecodedAccessToken` to get the decoded access token of the user. description: Use `nhost.auth.getDecodedAccessToken` to get the decoded access token of the user.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L523 custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L528
--- ---
# `getDecodedAccessToken()` # `getDecodedAccessToken()`

View File

@@ -4,7 +4,7 @@ title: getHasuraClaims()
sidebar_label: getHasuraClaims() sidebar_label: getHasuraClaims()
slug: /reference/javascript/auth/get-hasura-claims slug: /reference/javascript/auth/get-hasura-claims
description: Use `nhost.auth.getHasuraClaims` to get the Hasura claims of the user. description: Use `nhost.auth.getHasuraClaims` to get the Hasura claims of the user.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L540 custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L545
--- ---
# `getHasuraClaims()` # `getHasuraClaims()`

View File

@@ -4,7 +4,7 @@ title: getHasuraClaim()
sidebar_label: getHasuraClaim() sidebar_label: getHasuraClaim()
slug: /reference/javascript/auth/get-hasura-claim slug: /reference/javascript/auth/get-hasura-claim
description: Use `nhost.auth.getHasuraClaim` to get the value of a specific Hasura claim of the user. description: Use `nhost.auth.getHasuraClaim` to get the value of a specific Hasura claim of the user.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L558 custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L563
--- ---
# `getHasuraClaim()` # `getHasuraClaim()`

View File

@@ -4,7 +4,7 @@ title: refreshSession()
sidebar_label: refreshSession() sidebar_label: refreshSession()
slug: /reference/javascript/auth/refresh-session slug: /reference/javascript/auth/refresh-session
description: Use `nhost.auth.refreshSession` to refresh the session with either the current internal refresh token or an external refresh token. description: Use `nhost.auth.refreshSession` to refresh the session with either the current internal refresh token or an external refresh token.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L581 custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L586
--- ---
# `refreshSession()` # `refreshSession()`

View File

@@ -4,7 +4,7 @@ title: getSession()
sidebar_label: getSession() sidebar_label: getSession()
slug: /reference/javascript/auth/get-session slug: /reference/javascript/auth/get-session
description: Use `nhost.auth.getSession()` to get the session of the user. description: Use `nhost.auth.getSession()` to get the session of the user.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L625 custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L627
--- ---
# `getSession()` # `getSession()`

View File

@@ -4,7 +4,7 @@ title: getUser()
sidebar_label: getUser() sidebar_label: getUser()
slug: /reference/javascript/auth/get-user slug: /reference/javascript/auth/get-user
description: Use `nhost.auth.getUser()` to get the signed-in user. description: Use `nhost.auth.getUser()` to get the signed-in user.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L640 custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L642
--- ---
# `getUser()` # `getUser()`

View File

@@ -4,7 +4,7 @@ title: HasuraAuthClient
sidebar_label: Auth sidebar_label: Auth
description: No description provided. description: No description provided.
slug: /reference/javascript/auth slug: /reference/javascript/auth
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L60 custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L59
--- ---
# `HasuraAuthClient` # `HasuraAuthClient`

View File

@@ -1,18 +0,0 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: ApiChangeEmailResponse
sidebar_label: ApiChangeEmailResponse
description: No description provided.
displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L181
---
# `ApiChangeEmailResponse`
## Parameters
---
**<span className="parameter-name">error</span>** <span className="optional-status">required</span> `null` | `ErrorPayload`
---

View File

@@ -1,18 +0,0 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: ApiChangePasswordResponse
sidebar_label: ApiChangePasswordResponse
description: No description provided.
displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L173
---
# `ApiChangePasswordResponse`
## Parameters
---
**<span className="parameter-name">error</span>** <span className="optional-status">required</span> `null` | `ErrorPayload`
---

View File

@@ -1,18 +0,0 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: ApiDeanonymizeResponse
sidebar_label: ApiDeanonymizeResponse
description: No description provided.
displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L185
---
# `ApiDeanonymizeResponse`
## Parameters
---
**<span className="parameter-name">error</span>** <span className="optional-status">required</span> `null` | `ErrorPayload`
---

View File

@@ -1,16 +0,0 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: ApiRefreshTokenResponse
sidebar_label: ApiRefreshTokenResponse
description: No description provided.
displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L161
---
# `ApiRefreshTokenResponse`
```ts
type ApiRefreshTokenResponse =
| { session: null; error: ErrorPayload }
| { session: Session; error: null }
```

View File

@@ -1,18 +0,0 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: ApiResetPasswordResponse
sidebar_label: ApiResetPasswordResponse
description: No description provided.
displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L169
---
# `ApiResetPasswordResponse`
## Parameters
---
**<span className="parameter-name">error</span>** <span className="optional-status">required</span> `null` | `ErrorPayload`
---

View File

@@ -1,18 +0,0 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: ApiSendVerificationEmailResponse
sidebar_label: ApiSendVerificationEmailResponse
description: No description provided.
displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L177
---
# `ApiSendVerificationEmailResponse`
## Parameters
---
**<span className="parameter-name">error</span>** <span className="optional-status">required</span> `null` | `ErrorPayload`
---

View File

@@ -1,29 +0,0 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: ApiSignInData
sidebar_label: ApiSignInData
description: No description provided.
displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L150
---
# `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

@@ -1,16 +0,0 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: ApiSignInResponse
sidebar_label: ApiSignInResponse
description: No description provided.
displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L154
---
# `ApiSignInResponse`
```ts
type ApiSignInResponse =
| { data: ApiSignInData; error: null }
| { data: null; error: ErrorPayload }
```

View File

@@ -1,18 +0,0 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: ApiSignOutResponse
sidebar_label: ApiSignOutResponse
description: No description provided.
displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L165
---
# `ApiSignOutResponse`
## Parameters
---
**<span className="parameter-name">error</span>** <span className="optional-status">required</span> `null` | `ErrorPayload`
---

View File

@@ -1,16 +0,0 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: ApiSignUpEmailPasswordResponse
sidebar_label: ApiSignUpEmailPasswordResponse
description: No description provided.
displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L146
---
# `ApiSignUpEmailPasswordResponse`
```ts
type ApiSignUpEmailPasswordResponse =
| { session: null; error: ErrorPayload }
| { session: Session; error: null }
```

View File

@@ -4,7 +4,7 @@ title: AuthChangeEvent
sidebar_label: AuthChangeEvent sidebar_label: AuthChangeEvent
description: No description provided. description: No description provided.
displayed_sidebar: referenceSidebar displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L134 custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L100
--- ---
# `AuthChangeEvent` # `AuthChangeEvent`

View File

@@ -4,7 +4,7 @@ title: AuthChangedFunction
sidebar_label: AuthChangedFunction sidebar_label: AuthChangedFunction
description: No description provided. description: No description provided.
displayed_sidebar: referenceSidebar displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L136 custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L102
--- ---
# `AuthChangedFunction` # `AuthChangedFunction`
@@ -12,6 +12,6 @@ custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-j
```ts ```ts
type AuthChangedFunction = () => ( type AuthChangedFunction = () => (
event: AuthChangeEvent, event: AuthChangeEvent,
session: Session | null session: NhostSession | null
) => void ) => void
``` ```

View File

@@ -4,7 +4,7 @@ title: ChangeEmailParams
sidebar_label: ChangeEmailParams sidebar_label: ChangeEmailParams
description: No description provided. description: No description provided.
displayed_sidebar: referenceSidebar displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L105 custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L82
--- ---
# `ChangeEmailParams` # `ChangeEmailParams`

View File

@@ -4,7 +4,7 @@ title: ChangePasswordParams
sidebar_label: ChangePasswordParams sidebar_label: ChangePasswordParams
description: No description provided. description: No description provided.
displayed_sidebar: referenceSidebar displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L96 custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L72
--- ---
# `ChangePasswordParams` # `ChangePasswordParams`
@@ -16,3 +16,7 @@ custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-j
**<span className="parameter-name">newPassword</span>** <span className="optional-status">required</span> `string` **<span className="parameter-name">newPassword</span>** <span className="optional-status">required</span> `string`
--- ---
**<span className="parameter-name">ticket</span>** <span className="optional-status">optional</span> `string`
---

View File

@@ -4,7 +4,7 @@ title: DeanonymizeParams
sidebar_label: DeanonymizeParams sidebar_label: DeanonymizeParams
description: No description provided. description: No description provided.
displayed_sidebar: referenceSidebar displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L110 custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L87
--- ---
# `DeanonymizeParams` # `DeanonymizeParams`

View File

@@ -1,18 +0,0 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: Headers
sidebar_label: Headers
description: No description provided.
displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L139
---
# `Headers`
## Parameters
---
**<span className="parameter-name">Authorization</span>** <span className="optional-status">optional</span> `string`
---

View File

@@ -1,18 +0,0 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: Mfa
sidebar_label: Mfa
description: No description provided.
displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L142
---
# `Mfa`
## Parameters
---
**<span className="parameter-name">ticket</span>** <span className="optional-status">required</span> `string`
---

View File

@@ -4,11 +4,11 @@ title: OnTokenChangedFunction
sidebar_label: OnTokenChangedFunction sidebar_label: OnTokenChangedFunction
description: No description provided. description: No description provided.
displayed_sidebar: referenceSidebar displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L138 custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L104
--- ---
# `OnTokenChangedFunction` # `OnTokenChangedFunction`
```ts ```ts
type OnTokenChangedFunction = () => (session: Session | null) => void type OnTokenChangedFunction = () => (session: NhostSession | null) => void
``` ```

View File

@@ -4,7 +4,7 @@ title: Provider
sidebar_label: Provider sidebar_label: Provider
description: No description provided. description: No description provided.
displayed_sidebar: referenceSidebar displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/core/src/types.ts#L140 custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/core/src/types.ts#L141
--- ---
# `Provider` # `Provider`

View File

@@ -4,7 +4,7 @@ title: ResetPasswordParams
sidebar_label: ResetPasswordParams sidebar_label: ResetPasswordParams
description: No description provided. description: No description provided.
displayed_sidebar: referenceSidebar displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L91 custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L67
--- ---
# `ResetPasswordParams` # `ResetPasswordParams`

View File

@@ -4,7 +4,7 @@ title: SendVerificationEmailParams
sidebar_label: SendVerificationEmailParams sidebar_label: SendVerificationEmailParams
description: No description provided. description: No description provided.
displayed_sidebar: referenceSidebar displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L100 custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L77
--- ---
# `SendVerificationEmailParams` # `SendVerificationEmailParams`

View File

@@ -1,30 +0,0 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: Session
sidebar_label: Session
description: No description provided.
displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L23
---
# `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

@@ -4,7 +4,7 @@ title: SignInEmailPasswordOtpParams
sidebar_label: SignInEmailPasswordOtpParams sidebar_label: SignInEmailPasswordOtpParams
description: No description provided. description: No description provided.
displayed_sidebar: referenceSidebar displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L59 custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L35
--- ---
# `SignInEmailPasswordOtpParams` # `SignInEmailPasswordOtpParams`

View File

@@ -4,7 +4,7 @@ title: SignInEmailPasswordParams
sidebar_label: SignInEmailPasswordParams sidebar_label: SignInEmailPasswordParams
description: No description provided. description: No description provided.
displayed_sidebar: referenceSidebar displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L54 custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L30
--- ---
# `SignInEmailPasswordParams` # `SignInEmailPasswordParams`

View File

@@ -4,7 +4,7 @@ title: SignInParams
sidebar_label: SignInParams sidebar_label: SignInParams
description: No description provided. description: No description provided.
displayed_sidebar: referenceSidebar displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L83 custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L59
--- ---
# `SignInParams` # `SignInParams`

View File

@@ -4,7 +4,7 @@ title: SignInPasswordlessEmailParams
sidebar_label: SignInPasswordlessEmailParams sidebar_label: SignInPasswordlessEmailParams
description: No description provided. description: No description provided.
displayed_sidebar: referenceSidebar displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L64 custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L40
--- ---
# `SignInPasswordlessEmailParams` # `SignInPasswordlessEmailParams`

View File

@@ -4,7 +4,7 @@ title: SignInPasswordlessSmsOtpParams
sidebar_label: SignInPasswordlessSmsOtpParams sidebar_label: SignInPasswordlessSmsOtpParams
description: No description provided. description: No description provided.
displayed_sidebar: referenceSidebar displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L74 custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L50
--- ---
# `SignInPasswordlessSmsOtpParams` # `SignInPasswordlessSmsOtpParams`

View File

@@ -4,7 +4,7 @@ title: SignInPasswordlessSmsParams
sidebar_label: SignInPasswordlessSmsParams sidebar_label: SignInPasswordlessSmsParams
description: No description provided. description: No description provided.
displayed_sidebar: referenceSidebar displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L69 custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L45
--- ---
# `SignInPasswordlessSmsParams` # `SignInPasswordlessSmsParams`

View File

@@ -1,34 +0,0 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: SignInReponse
sidebar_label: SignInReponse
description: No description provided.
displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L123
---
# `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` | `ErrorPayload`
---
**<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

@@ -1,34 +0,0 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: SignInResponse
sidebar_label: SignInResponse
description: No description provided.
displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L45
---
# `SignInResponse`
## 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">mfa</span>** <span className="optional-status">required</span> `null` | `{ ticket: string }`
---
**<span className="parameter-name">error</span>** <span className="optional-status">required</span> `null` | `ErrorPayload`
---
**<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

@@ -4,7 +4,7 @@ title: SignInWithProviderOptions
sidebar_label: SignInWithProviderOptions sidebar_label: SignInWithProviderOptions
description: No description provided. description: No description provided.
displayed_sidebar: referenceSidebar displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L78 custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L54
--- ---
# `SignInWithProviderOptions` # `SignInWithProviderOptions`

View File

@@ -4,7 +4,7 @@ title: SignUpEmailPasswordParams
sidebar_label: SignUpEmailPasswordParams sidebar_label: SignUpEmailPasswordParams
description: No description provided. description: No description provided.
displayed_sidebar: referenceSidebar displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L31 custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L23
--- ---
# `SignUpEmailPasswordParams` # `SignUpEmailPasswordParams`

View File

@@ -4,7 +4,7 @@ title: SignUpParams
sidebar_label: SignUpParams sidebar_label: SignUpParams
description: No description provided. description: No description provided.
displayed_sidebar: referenceSidebar displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L37 custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L29
--- ---
# `SignUpParams` # `SignUpParams`

View File

@@ -1,16 +0,0 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: SignUpResponse
sidebar_label: SignUpResponse
description: No description provided.
displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L39
---
# `SignUpResponse`
```ts
type SignUpResponse =
| { session: null; error: ErrorPayload }
| { session: Session | null; error: null }
```

View File

@@ -4,7 +4,7 @@ title: User
sidebar_label: User sidebar_label: User
description: User information description: User information
displayed_sidebar: referenceSidebar displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/core/src/types.ts#L93 custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/core/src/types.ts#L94
--- ---
# `User` # `User`

View File

@@ -15,18 +15,18 @@ custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/nhost-js/src/
**<span className="parameter-name">config</span>** <span className="optional-status">required</span> [`NhostClientConstructorParams`](/reference/docgen/javascript/nhost-js/types/nhost-client-constructor-params) **<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 | | Property | Type | Required | Notes |
| :----------------------------------------------------------------------------------------------------- | :------------------ | :------: | :---------------------------------------------------------------------------------------------------------------------------- | | :----------------------------------------------------------------------------------------------------- | :------------------ | :------: | :--------------------------------------------------------------------------------------------------------------------------------------- |
| <span className="parameter-name"><span className="light-grey">config.</span>refreshIntervalTime</span> | `number` | | Time interval until token refreshes, in seconds | | <span className="parameter-name"><span className="light-grey">config.</span>refreshIntervalTime</span> | `number` | | Time interval until token refreshes, in seconds |
| <span className="parameter-name"><span className="light-grey">config.</span>clientStorageType</span> | `ClientStorageType` | | Define a way to get information about the refresh token and its exipration date. | | <span className="parameter-name"><span className="light-grey">config.</span>clientStorageType</span> | `ClientStorageType` | | Define a way to get information about the refresh token and its exipration date. |
| <span className="parameter-name"><span className="light-grey">config.</span>clientStorage</span> | `ClientStorage` | | Object where the refresh token will be persisted and read locally. | | <span className="parameter-name"><span className="light-grey">config.</span>clientStorage</span> | `ClientStorage` | | Object where the refresh token will be persisted and read locally. |
| <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"><span className="light-grey">config.</span>autoRefreshToken</span> | `boolean` | | When set to true, will automatically refresh token before it expires |
| <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>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>devTools</span> | `boolean` | | Activate devTools e.g. the ability to connect to the xstate inspector | | <span className="parameter-name"><span className="light-grey">config.</span>devTools</span> | `boolean` | | Activate devTools e.g. the ability to connect to the xstate inspector |
| <span className="parameter-name"><span className="light-grey">config.</span>start</span> | `boolean` | | | | <span className="parameter-name"><span className="light-grey">config.</span>start</span> | `boolean` | | |
| <span className="parameter-name"><span className="light-grey">config.</span>backendUrl</span> | `string` | | Nhost backend URL Should only be used when self-hosting | | <span className="parameter-name"><span className="light-grey">config.</span>backendUrl</span> | `string` | | Nhost backend URL Should only be used when self-hosting |
| <span className="parameter-name"><span className="light-grey">config.</span>adminSecret</span> | `string` | | When set, the admin secret is sent as a header, `x-hasura-admin-secret`, for all requests to GraphQL, Storage, and Functions. | | <span className="parameter-name"><span className="light-grey">config.</span>adminSecret</span> | `string` | | When set, the admin secret is sent as a header, `x-hasura-admin-secret`, for all requests to GraphQL, Storage, and Serverless Functions. |
| <span className="parameter-name"><span className="light-grey">config.</span>subdomain</span> | `string` | | App subdomain (e.g, ieingiwnginwnfnegqwvdqwdwq) Should be used when using the Nhost platform Use "localhost" in development | | <span className="parameter-name"><span className="light-grey">config.</span>subdomain</span> | `string` | | Project subdomain (e.g. `ieingiwnginwnfnegqwvdqwdwq`) Use `localhost` during local development |
| <span className="parameter-name"><span className="light-grey">config.</span>region</span> | `string` | | App region (e.g., eu-central-1) Not required in development (when `subdomain` is "localhost") | | <span className="parameter-name"><span className="light-grey">config.</span>region</span> | `string` | | Project region (e.g. `eu-central-1`) Project region is not required during local development (when `subdomain` is `localhost`) |
--- ---

View File

@@ -21,18 +21,18 @@ const nhost = new NhostClient({ subdomain, region })
**<span className="parameter-name">\_\_namedParameters</span>** <span className="optional-status">required</span> [`NhostClientConstructorParams`](/reference/docgen/javascript/nhost-js/types/nhost-client-constructor-params) **<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 | | Property | Type | Required | Notes |
| :------------------------------------------------------------------------------------------------------------------ | :------------------ | :------: | :---------------------------------------------------------------------------------------------------------------------------- | | :------------------------------------------------------------------------------------------------------------------ | :------------------ | :------: | :--------------------------------------------------------------------------------------------------------------------------------------- |
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>region</span> | `string` | | App region (e.g., eu-central-1) Not required in development (when `subdomain` is "localhost") | | <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>region</span> | `string` | | Project region (e.g. `eu-central-1`) Project region is not required during local development (when `subdomain` is `localhost`) |
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>subdomain</span> | `string` | | App subdomain (e.g, ieingiwnginwnfnegqwvdqwdwq) Should be used when using the Nhost platform Use "localhost" in development | | <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>subdomain</span> | `string` | | Project subdomain (e.g. `ieingiwnginwnfnegqwvdqwdwq`) Use `localhost` during local development |
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>adminSecret</span> | `string` | | When set, the admin secret is sent as a header, `x-hasura-admin-secret`, for all requests to GraphQL, Storage, and Functions. | | <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>adminSecret</span> | `string` | | When set, the admin secret is sent as a header, `x-hasura-admin-secret`, for all requests to GraphQL, Storage, and Serverless Functions. |
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>backendUrl</span> | `string` | | Nhost backend URL Should only be used when self-hosting | | <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>backendUrl</span> | `string` | | Nhost backend URL Should only be used when self-hosting |
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>start</span> | `boolean` | | | | <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>start</span> | `boolean` | | |
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>devTools</span> | `boolean` | | Activate devTools e.g. the ability to connect to the xstate inspector | | <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>devTools</span> | `boolean` | | Activate devTools e.g. the ability to connect to the xstate inspector |
| <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"><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"><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>autoRefreshToken</span> | `boolean` | | When set to true, will automatically refresh token before it expires |
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>clientStorage</span> | `ClientStorage` | | Object where the refresh token will be persisted and read locally. | | <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>clientStorage</span> | `ClientStorage` | | Object where the refresh token will be persisted and read locally. |
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>clientStorageType</span> | `ClientStorageType` | | Define a way to get information about the refresh token and its exipration date. | | <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>clientStorageType</span> | `ClientStorageType` | | Define a way to get information about the refresh token and its exipration date. |
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>refreshIntervalTime</span> | `number` | | Time interval until token refreshes, in seconds | | <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>refreshIntervalTime</span> | `number` | | Time interval until token refreshes, in seconds |
--- ---

View File

@@ -3,13 +3,13 @@
title: request() title: request()
sidebar_label: request() sidebar_label: request()
slug: /reference/javascript/nhost-js/graphql/request slug: /reference/javascript/nhost-js/graphql/request
description: Use `nhost.graphql.request` to send a GraphQL request. For more serious GraphQL usage in your app we recommend using a GraphQL client such as Apollo Client (https://www.apollographql.com/docs/react). description: Use `nhost.graphql.request` to send a GraphQL request. For more serious GraphQL usage we recommend using a GraphQL client such as Apollo Client (https://www.apollographql.com/docs/react).
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/nhost-js/src/clients/graphql.ts#L55 custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/nhost-js/src/clients/graphql.ts#L55
--- ---
# `request()` # `request()`
Use `nhost.graphql.request` to send a GraphQL request. For more serious GraphQL usage in your app we recommend using a GraphQL client such as Apollo Client (https://www.apollographql.com/docs/react). Use `nhost.graphql.request` to send a GraphQL request. For more serious GraphQL usage we recommend using a GraphQL client such as Apollo Client (https://www.apollographql.com/docs/react).
```ts ```ts
const CUSTOMERS = gql` const CUSTOMERS = gql`

View File

@@ -4,7 +4,7 @@ title: BackendOrSubdomain
sidebar_label: BackendOrSubdomain sidebar_label: BackendOrSubdomain
description: No description provided. description: No description provided.
displayed_sidebar: referenceSidebar displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/nhost-js/src/utils/types.ts#L40 custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/nhost-js/src/utils/types.ts#L39
--- ---
# `BackendOrSubdomain` # `BackendOrSubdomain`

View File

@@ -4,7 +4,7 @@ title: FunctionCallResponse
sidebar_label: FunctionCallResponse sidebar_label: FunctionCallResponse
description: No description provided. description: No description provided.
displayed_sidebar: referenceSidebar displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/nhost-js/src/utils/types.ts#L57 custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/nhost-js/src/utils/types.ts#L56
--- ---
# `FunctionCallResponse` # `FunctionCallResponse`

View File

@@ -4,7 +4,7 @@ title: GraphqlRequestResponse
sidebar_label: GraphqlRequestResponse sidebar_label: GraphqlRequestResponse
description: No description provided. description: No description provided.
displayed_sidebar: referenceSidebar displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/nhost-js/src/utils/types.ts#L47 custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/nhost-js/src/utils/types.ts#L46
--- ---
# `GraphqlRequestResponse` # `GraphqlRequestResponse`

View File

@@ -4,7 +4,7 @@ title: GraphqlResponse
sidebar_label: GraphqlResponse sidebar_label: GraphqlResponse
description: No description provided. description: No description provided.
displayed_sidebar: referenceSidebar displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/nhost-js/src/utils/types.ts#L67 custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/nhost-js/src/utils/types.ts#L66
--- ---
# `GraphqlResponse` # `GraphqlResponse`

View File

@@ -4,7 +4,7 @@ title: NhostClientConstructorParams
sidebar_label: NhostClientConstructorParams sidebar_label: NhostClientConstructorParams
description: No description provided. description: No description provided.
displayed_sidebar: referenceSidebar displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/nhost-js/src/utils/types.ts#L42 custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/nhost-js/src/utils/types.ts#L41
--- ---
# `NhostClientConstructorParams` # `NhostClientConstructorParams`
@@ -79,21 +79,20 @@ Should only be used when self-hosting
**<span className="parameter-name">adminSecret</span>** <span className="optional-status">optional</span> `string` **<span className="parameter-name">adminSecret</span>** <span className="optional-status">optional</span> `string`
When set, the admin secret is sent as a header, `x-hasura-admin-secret`, When set, the admin secret is sent as a header, `x-hasura-admin-secret`,
for all requests to GraphQL, Storage, and Functions. for all requests to GraphQL, Storage, and Serverless Functions.
--- ---
**<span className="parameter-name">subdomain</span>** <span className="optional-status">optional</span> `string` **<span className="parameter-name">subdomain</span>** <span className="optional-status">optional</span> `string`
App subdomain (e.g, ieingiwnginwnfnegqwvdqwdwq) Project subdomain (e.g. `ieingiwnginwnfnegqwvdqwdwq`)
Should be used when using the Nhost platform Use `localhost` during local development
Use "localhost" in development
--- ---
**<span className="parameter-name">region</span>** <span className="optional-status">optional</span> `string` **<span className="parameter-name">region</span>** <span className="optional-status">optional</span> `string`
App region (e.g., eu-central-1) Project region (e.g. `eu-central-1`)
Not required in development (when `subdomain` is "localhost") Project region is not required during local development (when `subdomain` is `localhost`)
--- ---

View File

@@ -3,25 +3,25 @@
title: upload() title: upload()
sidebar_label: upload() sidebar_label: upload()
slug: /reference/javascript/storage/upload slug: /reference/javascript/storage/upload
description: Use `nhost.storage.upload` to upload a file. The `file` must be of type [`File`](https://developer.mozilla.org/en-US/docs/Web/API/File). description: Use `nhost.storage.upload` to upload a file.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-storage-js/src/packages/hasura-storage-js/src/hasura-storage-client.ts#L52 custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-storage-js/src/packages/hasura-storage-js/src/hasura-storage-client.ts#L76
--- ---
# `upload()` # `upload()`
Use `nhost.storage.upload` to upload a file. The `file` must be of type [`File`](https://developer.mozilla.org/en-US/docs/Web/API/File). ## Overload 1 of 2
If no `bucket` is specified the `default` bucket will be used. Use `nhost.storage.upload` to upload a file.
```ts It's possible to use [`File`](https://developer.mozilla.org/en-US/docs/Web/API/File) or [`FormData`](https://developer.mozilla.org/en-US/docs/Web/API/FormData) to upload a file. The `File` instance is only available in the browser while `FormData` with [`form-data`](https://www.npmjs.com/package/form-data) works both in the browser and in NodeJS (server).
await nhost.storage.upload({ file })
```
## Parameters If no `bucketId` is specified the bucket `default` is used.
### Parameters
--- ---
**<span className="parameter-name">params</span>** <span className="optional-status">required</span> [`StorageUploadParams`](/reference/docgen/javascript/storage/types/storage-upload-params) **<span className="parameter-name">params</span>** <span className="optional-status">required</span> [`StorageUploadFileParams`](/reference/docgen/javascript/storage/types/storage-upload-file-params)
| Property | Type | Required | Notes | | Property | Type | Required | Notes |
| :------------------------------------------------------------------------------------------ | :------- | :------: | :---- | | :------------------------------------------------------------------------------------------ | :------- | :------: | :---- |
@@ -32,12 +32,44 @@ await nhost.storage.upload({ file })
--- ---
## Examples ### Examples
Upload a file from a browser using `File`.
```ts ```ts
await nhost.storage.upload({ file }) await nhost.storage.upload({ file })
``` ```
Upload a file from a browser using `File` to a specific Bucket.
```ts ```ts
await nhost.storage.upload({ file, bucketId: '<Bucket-ID>' }) await nhost.storage.upload({ file, bucketId: '<Bucket-ID>' })
``` ```
Upload a file from a server using `FormData` with [`form-data`](https://www.npmjs.com/package/form-data).
```ts
const fd = new FormData()
fd.append('file', fs.createReadStream('./tests/assets/sample.pdf'))
await storage.upload({
formData: fd
})
```
## Overload 2 of 2
### Parameters
---
**<span className="parameter-name">params</span>** <span className="optional-status">required</span> [`StorageUploadFormDataParams`](/reference/docgen/javascript/storage/types/storage-upload-form-data-params)
| Property | Type | Required | Notes |
| :------------------------------------------------------------------------------------------ | :--------- | :------: | :---- |
| <span className="parameter-name"><span className="light-grey">params.</span>formData</span> | `FormData` | ✔️ | |
| <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

@@ -5,7 +5,7 @@ sidebar_label: getUrl()
slug: /reference/javascript/storage/get-url slug: /reference/javascript/storage/get-url
sidebar_class_name: deprecated sidebar_class_name: deprecated
description: No description provided. description: No description provided.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-storage-js/src/packages/hasura-storage-js/src/hasura-storage-client.ts#L74 custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-storage-js/src/packages/hasura-storage-js/src/hasura-storage-client.ts#L106
--- ---
# `getUrl()` # `getUrl()`

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