Compare commits

...

218 Commits

Author SHA1 Message Date
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
Pilou
024f026241 Merge pull request #839 from nhost/changeset-release/main
chore: update versions
2022-07-19 10:43:17 +02:00
Johan Eliasson
736b0512da meta updates 2022-07-19 10:22:45 +02:00
Pierre-Louis Mercereau
a422a4850d chore: correct peer deps bumps 2022-07-19 09:54:46 +02:00
github-actions[bot]
a7e67979fe chore: update versions 2022-07-19 07:48:08 +00:00
Pilou
1dcbf268db Merge pull request #820 from nhost/feat/sms-hook-and-composable
feat: useSignInSmsPasswordless
2022-07-19 09:47:05 +02:00
Pilou
5c5d489740 Merge pull request #841 from nhost/contributors-readme-action-mLUJqJcCpL
contributors readme action update
2022-07-19 09:46:51 +02:00
github-actions[bot]
a2559e3482 contrib-readme-action has updated readme 2022-07-19 07:46:19 +00:00
Pilou
bbef104a85 Merge pull request #840 from nhost/contributors-readme-action-MWLllvW8wS
contributors readme action update
2022-07-19 09:46:05 +02:00
github-actions[bot]
7843b1aec1 contrib-readme-action has updated readme 2022-07-19 07:41:45 +00:00
Pilou
4711bfa8ec Merge pull request #679 from Svarto/feat/changePassword-with-ticket
included an optional ticket in changePassword function to allow for c…
2022-07-19 09:41:27 +02:00
Pilou
6f3f8a5020 Merge pull request #838 from nhost/fix-providers
added twitch as provider
2022-07-19 09:38:32 +02:00
Pilou
a120bcc8fc Merge pull request #828 from dminkovsky/dminkovsky/fix-react-native-build
Fix React Native build
2022-07-19 09:36:02 +02:00
Johan Eliasson
53e20e87f3 Revert "Create stale-bags-design.md"
This reverts commit 9479aeb596.
2022-07-19 09:18:24 +02:00
Johan Eliasson
9479aeb596 Create stale-bags-design.md 2022-07-19 09:10:25 +02:00
Pilou
c4f11af072 Merge pull request #837 from nhost/contributors-readme-action-ZK2-b_IYkd
contributors readme action update
2022-07-19 09:07:47 +02:00
Johan Eliasson
747aa96914 Create dry-radios-allow.md 2022-07-19 09:07:43 +02:00
Johan Eliasson
5682d92592 added twitch as provider 2022-07-19 09:06:51 +02:00
github-actions[bot]
2cf6556499 contrib-readme-action has updated readme 2022-07-19 07:06:07 +00:00
Johan Eliasson
89553fcaf6 Merge pull request #830 from QuestGiverOrg/main
Add discord to provider types
2022-07-19 09:05:48 +02:00
Johan Eliasson
10beea7246 Create nine-students-design.md 2022-07-19 09:03:06 +02:00
Johan Eliasson
1334ddb693 added package.json export for all npm packages 2022-07-19 09:02:23 +02:00
Pilou
d212128815 Merge pull request #829 from nhost/changeset-release/main
chore: update versions
2022-07-16 15:22:46 +02:00
Gavan Wilhite
302c28b202 Merge pull request #1 from QuestGiverOrg/Adding-discord-to-provider-type
Added discord to provider type
2022-07-15 13:28:45 -07:00
Gavan Wilhite
f3f760b987 Added discord to provider type 2022-07-15 13:24:32 -07:00
github-actions[bot]
9d9caf9834 chore: update versions 2022-07-15 20:20:38 +00:00
Pilou
96cbf023ca Merge pull request #824 from nhost/docs/react-apollo-example-improvements
React Apollo example improvements
2022-07-15 22:19:01 +02:00
Pierre-Louis Mercereau
1ed534cb4a Merge branch 'main' into docs/react-apollo-example-improvements 2022-07-15 22:06:07 +02:00
Pilou
dcdee0b426 Merge pull request #819 from nhost/docs/vue-example-improvements
Vue example improvements
2022-07-15 22:02:58 +02:00
Pierre-Louis Mercereau
e31f4756b4 fix(vue-example): disabled & loading buttons 2022-07-15 20:13:44 +02:00
Pierre-Louis Mercereau
259e198d80 fix(react-apollo-example): fixed logo width 2022-07-15 19:45:22 +02:00
Pierre-Louis Mercereau
1d10a47414 fix(react-apollo-example): fit image logo 2022-07-15 19:42:37 +02:00
Dmitry Minkovsky
34470ff6e0 Fix React Native build fail 2022-07-15 12:11:18 -04:00
Pierre-Louis Mercereau
f30d6779bb chore: bump @apollo/client to v3.6.9 2022-07-15 15:55:29 +02:00
Pierre-Louis Mercereau
2a3b2c3af5 Merge branch 'main' into docs/vue-example-improvements 2022-07-15 15:39:38 +02:00
Pierre-Louis Mercereau
a0db6b58de chore: add hasura-auth 0.10 metadata 2022-07-15 12:06:08 +02:00
Pierre-Louis Mercereau
523d52aa7f Merge branch 'main' into docs/react-apollo-example-improvements 2022-07-15 11:48:41 +02:00
Pierre-Louis Mercereau
6e1ee1802d docs: explicit pnpm run 2022-07-15 11:45:45 +02:00
Pierre-Louis Mercereau
51ad1eb355 fix(react-apollo-example): qrcode img by alttext 2022-07-15 11:39:22 +02:00
Johan Eliasson
ee2dd8481b Merge pull request #825 from nhost/changeset-release/main
chore: update versions
2022-07-15 11:21:12 +02:00
github-actions[bot]
b8e787cb47 chore: update versions 2022-07-15 09:18:40 +00:00
Johan Eliasson
2ef5c238c1 Merge pull request #823 from nhost/patch/cookies
patch: Using same cookie package and made sure cookies are not becoming session cookies
2022-07-15 11:17:04 +02:00
Pierre-Louis Mercereau
e084643032 docs: correct readme 2022-07-15 11:11:35 +02:00
Pierre-Louis Mercereau
5514e81186 docs: update readme 2022-07-15 11:10:44 +02:00
Pierre-Louis Mercereau
16f38aa893 docs(example): update readme instructions 2022-07-15 11:09:08 +02:00
Pierre-Louis Mercereau
76c6e8d0d6 feat(react-apollo-example): improve navbar & index 2022-07-15 10:33:27 +02:00
Johan Eliasson
197d1d5cfc Create lovely-windows-accept.md 2022-07-15 10:03:25 +02:00
Johan Eliasson
abd43d0a8b typo 2022-07-15 09:49:03 +02:00
Johan Eliasson
70383c8c80 same cookie lib + added expires prop to avoid cookie being destroyed 2022-07-15 09:45:19 +02:00
Pierre-Louis Mercereau
a7d5c85f60 fix(example): hide nav drawer on small screens 2022-07-15 09:35:28 +02:00
Pierre-Louis Mercereau
bc657251d6 fix: remove refresh token from the url 2022-07-14 22:07:59 +02:00
Pierre-Louis Mercereau
5abc362a4d fix(example): close magic link sent dialog 2022-07-14 15:10:11 +02:00
Pierre-Louis Mercereau
7a4c9fa806 refactor(example): use form submit 2022-07-14 15:06:57 +02:00
Pierre-Louis Mercereau
348318d709 feat(example): add dialog after magic link is sent 2022-07-14 14:48:30 +02:00
Pierre-Louis Mercereau
4e4600d769 refactor: improve readability 2022-07-14 09:13:55 +02:00
Pierre-Louis Mercereau
44d57d4b89 refactor: from comments 2022-07-14 09:04:16 +02:00
Pierre-Louis Mercereau
84ba29dd7f feat: useSignInSmsPasswordless 2022-07-13 20:39:17 +02:00
Pierre-Louis Mercereau
b5f7f7fe5f refactor(example): toast errors on top of window 2022-07-13 19:45:38 +02:00
Pierre-Louis Mercereau
7116a4df8a refactor(example): misc improvements 2022-07-13 19:39:11 +02:00
Pierre-Louis Mercereau
7e4c52dbd1 feat(example): add title and GitHub link 2022-07-13 17:20:55 +02:00
Pierre-Louis Mercereau
446dc01bde feat(example): toast anonymous user errors 2022-07-13 17:07:25 +02:00
Pierre-Louis Mercereau
a1989c51f8 feat(example): enable anonymous users in the backend 2022-07-13 17:00:59 +02:00
Pierre-Louis Mercereau
1383de558a feat(example): add email verification dialog on sign-in 2022-07-13 17:00:39 +02:00
Pierre-Louis Mercereau
d828107f74 fix(example): remove "return" from previous "setup()" syntax 2022-07-13 16:43:10 +02:00
Pierre-Louis Mercereau
4a1650cb35 refactor(example): use the template "setup" syntax 2022-07-13 16:37:23 +02:00
Pierre-Louis Mercereau
913651d440 feat(example): add "verification email sent" dialog 2022-07-13 16:29:40 +02:00
Pierre-Louis Mercereau
6af2d52666 chore(vue): bump dependencies 2022-07-13 15:52:12 +02:00
Pilou
da7c2a2362 Merge pull request #818 from nhost/chore/hasura-storage-0.2.3
chore: bump hasura-storage version to 0.2.3
2022-07-13 15:25:04 +02:00
Pierre-Louis Mercereau
4a7940b59a chore: bump hasura-storage version to 0.2.3 2022-07-13 15:10:39 +02:00
Pilou
ddda8bb031 Merge pull request #817 from nhost/chore/hasura-auth-0.10.0
chore: bump hasura-auth version to 0.10.0
2022-07-13 13:28:52 +02:00
Pierre-Louis Mercereau
b146e60f7e chore: bump hasura-auth version to 0.10.0 2022-07-13 11:02:40 +02:00
Pilou
5591789840 Merge pull request #816 from nhost/contributors-readme-action-wpdtyjiZOQ
contributors readme action update
2022-07-13 10:12:05 +02:00
github-actions[bot]
fac5ddb866 contrib-readme-action has updated readme 2022-07-13 05:09:22 +00:00
Johan Eliasson
f2fab8dac2 Merge pull request #784 from nachoaldamav/patch-1
docs: Add "redirectTo" to provider sign-in
2022-07-13 07:09:03 +02:00
Pilou
6e3f2c382d Merge pull request #807 from nhost/doc/vue-live-example
fix: wrong package name
2022-07-07 17:53:51 +02:00
Pilou
05385d01dc Merge pull request #809 from nhost/contributors-readme-action-l3DsL6Hz69
contributors readme action update
2022-07-07 16:37:59 +02:00
github-actions[bot]
7ea72b799c contrib-readme-action has updated readme 2022-07-07 14:10:36 +00:00
Pilou
4936261cee Merge pull request #808 from nhost/docs/docker-functions
refactor: use nhost/functions docker image
2022-07-07 16:09:10 +02:00
Pierre-Louis Mercereau
80902b9cf1 refactor: use nhost/functions docker image 2022-07-07 15:53:30 +02:00
Pierre-Louis Mercereau
c3af490e67 fix: wrong package name 2022-07-07 14:32:13 +02:00
Pilou
6a24e32857 Merge pull request #806 from nhost/doc/vue-live-example
Vue example: add env var deps in turborepo
2022-07-07 14:21:38 +02:00
Pierre-Louis Mercereau
0ebddd30cf ci: add env var deps in turborepo 2022-07-07 14:17:11 +02:00
Johan Eliasson
d019f1de21 Merge pull request #805 from nhost/doc/vue-live-example
Adapt Vue-Apollo example to live demo
2022-07-07 12:35:02 +02:00
Pierre-Louis Mercereau
3abb57f510 chore: add vercel.json to handle redirections 2022-07-07 11:20:26 +02:00
Pierre-Louis Mercereau
4a2ad15f14 docs: adapt Vue-Apollo example to live demo 2022-07-07 11:17:02 +02:00
Pilou
ca45b612c9 Merge pull request #773 from nhost/build/sync-versions
Sync the Nhost services versions within the repository
2022-07-07 10:43:18 +02:00
Pilou
27ee9b721f Merge pull request #804 from nhost/docs/oauth-providers-alphabetic
Docs: List OAuth providers in order
2022-07-07 10:43:04 +02:00
Johan Eliasson
2a373dd50f revert 2022-07-07 10:36:37 +02:00
Johan Eliasson
a91f714c4c order 2022-07-07 10:34:51 +02:00
Pilou
3b4d89d5b6 Merge pull request #803 from nhost/elitan-patch-2
Missing `services:` in nhost config
2022-07-07 10:31:40 +02:00
Johan Eliasson
16d1b26298 Update config.yaml 2022-07-07 10:29:24 +02:00
Pierre-Louis Mercereau
86d8beb044 chore: update lockfile 2022-07-07 10:27:53 +02:00
Pierre-Louis Mercereau
17f870f31f Merge branch 'main' into build/sync-versions 2022-07-07 10:26:17 +02:00
Pilou
fbfffe25ca Merge pull request #799 from nhost/docs/discord-signin
Docs: Sign in with Discord and Twitch
2022-07-07 09:46:01 +02:00
Pilou
87a472b27e Merge pull request #802 from nhost/docs/video-iuasd
Docs: Update videos
2022-07-07 09:44:46 +02:00
Johan Eliasson
779b03b0b2 delete unused video 2022-07-07 07:16:00 +02:00
Johan Eliasson
9d933b6ffd open hasura console 2022-07-07 07:12:23 +02:00
Johan Eliasson
34d643868d typos 2022-07-06 20:25:47 +02:00
Johan Eliasson
0023f5f6f6 og images 2022-07-06 20:24:48 +02:00
Johan Eliasson
48f5c8bfb9 added docs for twitch + images 2022-07-06 20:22:12 +02:00
Johan Eliasson
f398b2e3ac update 2022-07-06 18:59:40 +02:00
Johan Eliasson
11795abe61 discord docs 2022-07-06 18:59:06 +02:00
Johan Eliasson
e2eafc9ee1 Merge pull request #796 from nhost/docs/apple-signin
Docs: Sign in with Apple
2022-07-06 07:29:30 +02:00
Pilou
4a5a2fac43 Merge pull request #794 from nhost/changeset-release/main
chore: update versions
2022-07-05 22:14:42 +02:00
Johan Eliasson
4a908af7ef old domain structure 2022-07-05 11:27:58 +02:00
Johan Eliasson
a7b6498053 update information about service id 2022-07-05 11:02:02 +02:00
Johan Eliasson
7f418a7559 started 2022-07-05 10:54:36 +02:00
github-actions[bot]
8493129750 chore: update versions 2022-07-05 08:03:48 +00:00
Pilou
26b817c5fa Merge pull request #788 from nhost/785-sms-passwordless-otp-sign-in-is-never-returning-or-rejecting-a-promise-on-failure
fix: return promise when using SMS OTP and an error occurs
2022-07-05 10:02:36 +02:00
Johan Eliasson
e61ea19421 Merge pull request #792 from nhost/timpratim-patch-2
Updated React quick-start ( without images )
2022-07-05 07:26:47 +02:00
Johan Eliasson
401f2cb540 updated react quick start 2022-07-05 07:18:15 +02:00
Johan Eliasson
6363a289fb Merge branch 'main' into timpratim-patch-2 2022-07-05 07:07:32 +02:00
Johan Eliasson
f09037ccef Merge pull request #783 from nhost/domain-structure
Docs: Use subdomain and region instead of backend url
2022-07-05 07:05:52 +02:00
Pratim
a4dea7339e Updated react quick-start ( without images ) 2022-07-05 00:24:34 +05:30
Pierre-Louis Mercereau
50474810bf refactor: run command with swc 2022-07-04 16:52:31 +02:00
Pilou
f356c7176b Merge pull request #789 from nhost/contributors-readme-action-K0Fk8ZdmGi
contributors readme action update
2022-07-04 16:50:59 +02:00
github-actions[bot]
cb99c6d989 contrib-readme-action has updated readme 2022-07-04 14:50:20 +00:00
Pilou
7cef49bb02 Merge pull request #761 from uulwake/chore/add-test-coverage
chore: add test coverage in every packages
2022-07-04 16:50:04 +02:00
Pierre-Louis Mercereau
6eaa5c7920 fix: return promise when using SMS OTP and an error occurs 2022-07-04 16:24:35 +02:00
Johan Eliasson
64574ee892 info for CLI 2022-07-03 10:39:25 +02:00
Johan Eliasson
d3d38b2631 update vue quickstart with subdomain and region 2022-07-03 10:36:15 +02:00
Johan Eliasson
023afae3cd updated redwoodjs guide with subdomain and region 2022-07-03 10:32:53 +02:00
Johan Eliasson
19d2242918 updated app dashboard image 2022-07-03 10:27:54 +02:00
Nacho Aldama
ead2c16aac Add "redirectTo" to documentation
When I was searching for the "redirectTo" param I didn't find anything in the docs, maybe it was my fault but I've missed this.

Sorry if this is duplicated.
2022-07-02 19:19:25 +02:00
Johan Eliasson
a5f02e8056 workding 2022-07-02 08:58:19 +02:00
Johan Eliasson
aeb85a1e01 u 2022-07-02 08:54:42 +02:00
Johan Eliasson
821912e23e Merge pull request #781 from nhost/docs/subdomain-readmes
docs: update to subdomains in readmes
2022-07-02 08:11:54 +02:00
Pierre-Louis Mercereau
8608a78eaf docs: update readmes to subdomains 2022-07-01 22:57:08 +02:00
Pilou
2d2da4f6e0 Merge pull request #778 from nhost/plmercereau-patch-1
Update docker compose readme
2022-07-01 11:18:19 +02:00
Pilou
19d7262b05 Update README.md 2022-07-01 08:07:37 +02:00
Johan Eliasson
1c750bd652 Merge pull request #769 from nhost/codegen-example
Example: Adding codegen example from blog post
2022-06-30 13:45:52 +02:00
Pierre-Louis Mercereau
8a3943a942 build: fix lockfile 2022-06-30 11:34:50 +02:00
Johan Eliasson
62385a7866 Merge branch 'main' into codegen-example 2022-06-30 11:00:23 +02:00
Pilou
9e21de3819 Merge pull request #771 from nhost/changeset-release/main
chore: update versions
2022-06-29 21:55:36 +02:00
Pierre-Louis Mercereau
c101a26ce5 build: clean lockfile, and build all packages 2022-06-29 17:55:15 +02:00
Pierre-Louis Mercereau
21fa83d115 build: adapt turborepo pipeline 2022-06-29 17:23:00 +02:00
Pierre-Louis Mercereau
522839d8f7 chore: keep original lockfile 2022-06-29 17:19:24 +02:00
Pierre-Louis Mercereau
87aad599f3 chore: update lockfile 2022-06-29 17:17:01 +02:00
Pierre-Louis Mercereau
5b097e635d chore: remove verbose 2022-06-29 17:10:43 +02:00
Pierre-Louis Mercereau
bfdcacd5a3 smaller eslintrc 2022-06-29 17:04:09 +02:00
Pierre-Louis Mercereau
dcb9055475 chore: remove console.log 2022-06-29 16:58:14 +02:00
Pierre-Louis Mercereau
6f0bf3d67c docs: typoe 2022-06-29 16:54:24 +02:00
Pierre-Louis Mercereau
3c96c561a0 chore: remove unused dependency 2022-06-29 16:45:33 +02:00
Pierre-Louis Mercereau
3d319364f3 build: sync nhost services versions 2022-06-29 16:44:15 +02:00
Johan Eliasson
80468ac3ac merge main and pnpm install 2022-06-29 14:54:37 +02:00
Johan Eliasson
d03653f1fd config update 2022-06-29 14:46:40 +02:00
Pierre-Louis Mercereau
a7f3599fb1 chore: unbump peer dep versions 2022-06-29 14:21:20 +02:00
github-actions[bot]
c789102189 chore: update versions 2022-06-29 12:11:21 +00:00
Pilou
b638173181 Merge pull request #768 from nhost/storage-improvements
Storage fixes and improvements
2022-06-29 14:10:11 +02:00
Pierre-Louis Mercereau
d65df02adb docs: format inline example 2022-06-29 14:08:49 +02:00
Johan Eliasson
5dff7ad5d3 README update 2022-06-29 13:40:29 +02:00
Johan Eliasson
9263bea2ae clear 2022-06-29 13:32:04 +02:00
Johan Eliasson
4f994b536e correct parameters 2022-06-29 13:15:13 +02:00
Pierre-Louis Mercereau
4f9287562e chore: changeset 2022-06-29 12:16:39 +02:00
Pierre-Louis Mercereau
58f82f9aad fix: adapt to new signature 2022-06-29 11:56:05 +02:00
Johan Eliasson
c907021313 update 2022-06-29 11:10:34 +02:00
Johan Eliasson
12a218b12c importing Nhost providers 2022-06-29 10:55:43 +02:00
Pierre-Louis Mercereau
196156ff93 build: use vite 2022-06-29 10:15:12 +02:00
Johan Eliasson
28ca032f70 adding public permissions 2022-06-29 08:26:41 +02:00
Johan Eliasson
38462c45b6 Merge pull request #762 from nhost/docs-seed
docs: Added seed data information
2022-06-29 08:22:38 +02:00
Johan Eliasson
8e03ed43b7 prepending with zeros 2022-06-29 08:21:31 +02:00
Johan Eliasson
333292ab89 adding codegen example from blog post 2022-06-29 08:17:42 +02:00
Pierre-Louis Mercereau
b4d52debff chore: wip 2022-06-28 18:49:38 +02:00
Pilou
287e48a51a Merge pull request #766 from nhost/docs/example-on-vercel
fix: force redirectTo link
2022-06-28 16:58:12 +02:00
Pierre-Louis Mercereau
9370e06b68 fix: simplify 2022-06-28 16:53:19 +02:00
Pierre-Louis Mercereau
d5b775c630 fix: force redirectTo link 2022-06-28 16:46:12 +02:00
Pilou
ea8e1df8da Merge pull request #743 from nhost/docs/example-on-vercel
React-apollo example on Vercel
2022-06-28 16:23:06 +02:00
Pierre-Louis Mercereau
ced8100168 build: adjust env vars in turborepo 2022-06-28 14:39:54 +02:00
Pierre-Louis Mercereau
36d6db526c feat: add perms to anonymous users & on delete 2022-06-28 14:36:58 +02:00
Pierre-Louis Mercereau
fb53e94193 feat: use CDN backend 2022-06-28 14:36:20 +02:00
Pierre-Louis Mercereau
165ff16cdc Merge branch 'main' into docs/example-on-vercel 2022-06-28 13:25:50 +02:00
Pierre-Louis Mercereau
e3ef4a0188 revert: keep localhost:1337 as default url 2022-06-28 12:21:18 +02:00
Pierre-Louis Mercereau
0dc01a99e9 add redirectTo to oauth links 2022-06-28 11:11:07 +02:00
Pierre-Louis Mercereau
0e782b8e99 chore: default backend url and update readme 2022-06-28 10:51:34 +02:00
Pierre-Louis Mercereau
3e9d864899 Merge branch 'main' into docs/example-on-vercel 2022-06-28 10:26:31 +02:00
Johan Eliasson
73e4702a1a wording 2022-06-28 08:33:41 +02:00
Johan Eliasson
93cc6bc1cf added seed data information 2022-06-28 07:35:49 +02:00
Ulrich Wake
db955e3b71 chore: add test coverage in every packages 2022-06-28 10:26:29 +07:00
Pierre-Louis Mercereau
2d1185f7ec chore: turborepo cache input 2022-06-22 16:33:51 +02:00
Pierre-Louis Mercereau
c6d4c5e943 chore: add VITE_NHOST_URL as a turborepo dep 2022-06-22 16:29:35 +02:00
Pierre-Louis Mercereau
0a536ccfda build: add vercel.json 2022-06-22 16:18:53 +02:00
Svarto
18ac56d097 added changeset for hasura-auth-js 2022-06-06 21:38:53 +02:00
Svarto
366fc2403d included an optional ticket in changePassword function to allow for changeing password of logged out users, matches hasura-auth #186 2022-06-06 21:27:44 +02:00
380 changed files with 15401 additions and 1855 deletions

View File

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

View File

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

View File

@@ -148,10 +148,10 @@ Here are some ways of contributing to making Nhost better:
</a>
</td>
<td align="center">
<a href="https://github.com/szilarddoro">
<img src="https://avatars.githubusercontent.com/u/310881?v=4" width="100;" alt="szilarddoro"/>
<a href="https://github.com/nunopato">
<img src="https://avatars.githubusercontent.com/u/1523504?v=4" width="100;" alt="nunopato"/>
<br />
<sub><b>Szilárd Dóró</b></sub>
<sub><b>Nuno Pato</b></sub>
</a>
</td>
<td align="center">
@@ -162,10 +162,10 @@ Here are some ways of contributing to making Nhost better:
</a>
</td>
<td align="center">
<a href="https://github.com/nunopato">
<img src="https://avatars.githubusercontent.com/u/1523504?v=4" width="100;" alt="nunopato"/>
<a href="https://github.com/szilarddoro">
<img src="https://avatars.githubusercontent.com/u/310881?v=4" width="100;" alt="szilarddoro"/>
<br />
<sub><b>Nuno Pato</b></sub>
<sub><b>Szilárd Dóró</b></sub>
</a>
</td>
<td align="center">
@@ -204,21 +204,28 @@ Here are some ways of contributing to making Nhost better:
<sub><b>Pratim</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/GavanWilhite">
<img src="https://avatars.githubusercontent.com/u/2085119?v=4" width="100;" alt="GavanWilhite"/>
<br />
<sub><b>Gavan Wilhite</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/FuzzyReason">
<img src="https://avatars.githubusercontent.com/u/62517920?v=4" width="100;" alt="FuzzyReason"/>
<br />
<sub><b>Vadim Smirnov</b></sub>
</a>
</td>
</td></tr>
<tr>
<td align="center">
<a href="https://github.com/macmac49">
<img src="https://avatars.githubusercontent.com/u/831190?v=4" width="100;" alt="macmac49"/>
<br />
<sub><b>Macmac49</b></sub>
</a>
</td></tr>
<tr>
</td>
<td align="center">
<a href="https://github.com/subhendukundu">
<img src="https://avatars.githubusercontent.com/u/20059141?v=4" width="100;" alt="subhendukundu"/>
@@ -253,13 +260,6 @@ Here are some ways of contributing to making Nhost better:
<br />
<sub><b>Filip Hájek</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/GavanWilhite">
<img src="https://avatars.githubusercontent.com/u/2085119?v=4" width="100;" alt="GavanWilhite"/>
<br />
<sub><b>Gavan Wilhite</b></sub>
</a>
</td></tr>
<tr>
<td align="center">
@@ -276,6 +276,13 @@ Here are some ways of contributing to making Nhost better:
<sub><b>Jerry Jäppinen</b></sub>
</a>
</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">
<a href="https://github.com/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 />
<sub><b>Savin Vadim</b></sub>
</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 align="center">
<a href="https://github.com/muttenzer">
@@ -303,8 +318,7 @@ Here are some ways of contributing to making Nhost better:
<br />
<sub><b>Muttenzer</b></sub>
</a>
</td></tr>
<tr>
</td>
<td align="center">
<a href="https://github.com/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 />
<sub><b>Colin Broderick</b></sub>
</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 align="center">
<a href="https://github.com/dohomi">
@@ -346,8 +368,7 @@ Here are some ways of contributing to making Nhost better:
<br />
<sub><b>Gaurav Agrawal</b></sub>
</a>
</td></tr>
<tr>
</td>
<td align="center">
<a href="https://github.com/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 />
<sub><b>Jacob Duval</b></sub>
</a>
</td>
</td></tr>
<tr>
<td align="center">
<a href="https://github.com/kylehayes">
<img src="https://avatars.githubusercontent.com/u/509932?v=4" width="100;" alt="kylehayes"/>
@@ -383,21 +405,35 @@ Here are some ways of contributing to making Nhost better:
<sub><b>Leo Thorp</b></sub>
</a>
</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">
<a href="https://github.com/MarcelloTheArcane">
<img src="https://avatars.githubusercontent.com/u/21159570?v=4" width="100;" alt="MarcelloTheArcane"/>
<br />
<sub><b>Max Reynolds</b></sub>
</a>
</td></tr>
<tr>
</td>
<td align="center">
<a href="https://github.com/nachoaldamav">
<img src="https://avatars.githubusercontent.com/u/22749943?v=4" width="100;" alt="nachoaldamav"/>
<br />
<sub><b>Nacho Aldama</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/ghoshnirmalya">
<img src="https://avatars.githubusercontent.com/u/6391763?v=4" width="100;" alt="ghoshnirmalya"/>
<br />
<sub><b>Nirmalya Ghosh</b></sub>
</a>
</td>
</td></tr>
<tr>
<td align="center">
<a href="https://github.com/quentin-decre">
<img src="https://avatars.githubusercontent.com/u/1137511?v=4" width="100;" alt="quentin-decre"/>
@@ -412,6 +448,13 @@ Here are some ways of contributing to making Nhost better:
<sub><b>Tapas Adhikary</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/uulwake">
<img src="https://avatars.githubusercontent.com/u/22399181?v=4" width="100;" alt="uulwake"/>
<br />
<sub><b>Ulrich Wake</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/komninoschat">
<img src="https://avatars.githubusercontent.com/u/29049104?v=4" width="100;" alt="komninoschat"/>

4
config/.husky/pre-commit Executable file
View File

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

8
config/.lintstagedrc.js Normal file
View File

@@ -0,0 +1,8 @@
module.exports = {
'packages/(docgen|hasura-auth-js|hasura-storage-js|nextjs|nhost-js|react|core|vue)/src/**/*.{js,ts,jsx,tsx}':
['pnpm docgen', 'git add docs'],
'(nhost-cloud.yaml|**/nhost/config.yaml)': () => [
'pnpm sync-versions',
"git add ':(glob)**/nhost/config.yaml'"
]
}

View File

@@ -1,5 +1,11 @@
# @nhost/docs
## 0.0.2
### Patch Changes
- 747aa969: fix: added twitch and discord as provider
## 0.0.1
### Patch Changes

View File

@@ -12,11 +12,11 @@ The following email templates are available:
- **signin-passwordless** - Magic Link
- **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
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.
@@ -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):
```txt
my-nhost-app/
my-nhost-project/
└── nhost/
├── config.yaml
├── emails/
@@ -70,7 +70,7 @@ As you see, the format is:
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

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 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)
- [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.
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
@@ -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
@@ -39,6 +39,6 @@ await nhost.auth.signIn({
## 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.
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
@@ -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:
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
nhost.auth.signIn({

View File

@@ -0,0 +1,98 @@
---
title: Sign In with Apple
sidebar_label: Apple
slug: /platform/authentication/sign-in-with-apple
image: /img/og/platform/sign-in-with-apple.png
---
Follow this guide to sign in users with Apple.
<p align="center">
<img
alt="Apple Sign In Preview"
src="/img/social-providers/apple-preview.svg"
width={480}
height={267}
/>
</p>
## Create Apple Developer Account
- Click on "Account" in the top menu.
- Create a new [Apple Developer account](https://developer.apple.com) if you don't have one already and sign in to the Apple Developer platform.
## Get an App ID
- Go to the [Apple Developer Dashboard](https://developer.apple.com/account/).
- Click on **Certificates, IDs & Profiles** in the left menu.
- Click on **Identifiers** in the left menu.
- Click on the "+" button in the header next to "Identifiers".
- Select **App IDs** and click **Continue**.
- Select type **App** and click **Continue**.
- Fill in the App information:
- Description.
- Bundle ID (ex. io.nhost.app or com.your-startup.app).
- Scroll down and check **Sign In With Apple**.
- Click **Continue** in the top right corner.
- Click **Register** in the top right corner.
- Click on the newly created app to see **Team ID**.
- **Team ID**: Copy and paste the **Team ID** to your Nhost OAuth settings for Apple.
## Get a Service ID
- Go to the [Apple Developer Dashboard](https://developer.apple.com/account/).
- Click on **Certificates, IDs & Profiles** in the left menu.
- Click on **Identifiers** in the left menu.
- Click on **Certificates, IDs & Profiles** in the left menu.
- Click on **Identifiers** in the left menu.
- Click on the "+" button in the header next to "Identifiers".
- Select **Service IDs** and click **Continue**.
- Fill in the Service information:
- Description.
- Identifier (Service ID) (ex. _service_.io.nhost.app or _service_.com.your-startup.app). Notice you can't use the same identifier as for the app so we recommend adding "service" at the beginning if the identifier.
- **Service ID**: Copy and paste the **Identifier (Service ID)** to your Nhost OAuth settings for Apple.
- Click **Continue** in the top right corner.
- Click **Register** in the top right corner.
- Click on the newly created service in the list of Identifiers.
- Click the checkbox to enable "Sign in with Apple".
- Click **Configure** next to "Sign in with Apple".
- Make sure your newly created Bundle ID is selected under Primary App ID.
- Add your base auth domain under "Domains and Subdomains". E.g. `<subdomain>.nhost.run`.
- Add the full callback URL under "Return URLs". E.g. `https://<subdomain>.nhost.run/v1/auth/signin/provider/apple/callback`.
- Click **Next**.
- Click **Done**.
- Click **Continue** in the top right corner.
- Click **Save** in the top right corner.
## Generate Key
- Go to the [Apple Developer Dashboard](https://developer.apple.com/account/).
- Click on **Certificates, IDs & Profiles** in the left menu.
- Click on **Keys** in the left menu.
- Click on **Create a key**.
- Fill in a name for your key.
- Click the checkbox to enable "Sign in with Apple".
- Click **Configure** next to "Sign in with Apple".
- Select your newly created App ID in the dropdown selector.
- Click **Save** in the top right corner.
- Click **Continue** in the top right corner.
- Click **Register** in the top right corner.
- **Key ID**: Copy and paste the **Key ID** to your Nhost OAuth settings for Apple.
- Click **Download** to download the key to your computer.
- **Private Key**: Copy and paste the content of the downloaded key to your Nhost OAuth settings for Apple.
## Sign In Users
Use the [Nhost JavaScript client](/reference/javascript) to sign in users:
```js
nhost.auth.signIn({
provider: 'apple'
})
```

View File

@@ -0,0 +1,45 @@
---
title: Sign In with Discord
sidebar_label: Discord
slug: /platform/authentication/sign-in-with-discord
image: /img/og/platform/sign-in-with-discord.png
---
Follow this guide to sign in users with Discord.
<p align="center">
<img
alt="Discord Sign In Preview"
src="/img/social-providers/discord-preview.svg"
width={480}
height={267}
/>
</p>
## Create Discord Account
- Create a new [Discord account](https://discord.com/) if you don't have one already.
## Create Discord App
- Sign in to the [Discord Developer Portal](https://discord.com/developers/applications).
- Click on **New Application** in the top right corner.
- Fill in the name of your Discord Application and click **Create**.
- Click on **OAuth2** settings in the left menu.
- Copy the **Client ID** and paste it into your Nhost OAuth settings for Discord.
- Click on **Reset Secret**.
- Click **Yes, do it** to generate a new secret.
- Copy the **Client Secret** and paste it into your Nhost OAuth settings for Discord.
- Click on **Add Redirect**.
- Copy and paste the callback URL from your Nhost OAuth settings for Discord to the input field in the Discord Developer portal.
- Click **Save Changes** to save the added callback URL.
## Sign In Users
Use the [Nhost JavaScript client](/reference/javascript) to sign in users:
```js
nhost.auth.signIn({
provider: 'discord'
})
```

View File

@@ -5,7 +5,7 @@ slug: /platform/authentication/sign-in-with-facebook
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">
<img
@@ -59,7 +59,7 @@ To make sure we can fetch all user data (email, profile picture and name). For t
## 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
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
---
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">
<img
@@ -44,7 +44,7 @@ Follow this guide to sign in users with GitHub with your Nhost App.
## 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
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
---
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">
<img
@@ -68,7 +68,7 @@ Follow this guide to sign in users with Google with your Nhost App.
## 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
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
---
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">
<img
@@ -51,7 +51,7 @@ Follow this guide to sign in users with LinkedIn with your Nhost App.
## 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
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
---
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">
<img
@@ -44,7 +44,7 @@ Follow this guide to sign in users with Spotify with your Nhost App.
## 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
nhost.auth.signIn({

View File

@@ -0,0 +1,47 @@
---
title: Sign In with Twitch
sidebar_label: Twitch
slug: /platform/authentication/sign-in-with-twitch
image: /img/og/platform/sign-in-with-twitch.png
---
Follow this guide to sign in users with Twitch.
<p align="center">
<img
alt="Twitch Sign In Preview"
src="/img/social-providers/twitch-preview.svg"
width={480}
height={267}
/>
</p>
## Create Twitch Account
- Create a new [Twitch account](https://twitch.tv/) if you don't have one already.
## Create Twitch App
- Sign in to the [Twitch Developer Console](https://dev.twitch.tv/console).
- Click on **Register Your Application**.
- Fill in a **Twitch application name**.
- Copy and paste the callback URL from your Nhost OAuth settings for Twitch to the input field under **OAuth Redirect URLs** and click **Add** to the right of the input field.
- Select an application **Category**. E.g. _Application Integration_.
- Click **Create**.
## Get Twitch Appplication Client ID and Client Secret
- Click on **Manage** on your newly created Twitch application.
- Copy the **Client ID** and paste it into your Nhost OAuth settings for Twitch.
- Click on **New Secret** to generate a new client secret.
- Copy the **Client Secret** and paste it into your Nhost OAuth settings for Twitch.
## Sign In Users
Use the [Nhost JavaScript client](/reference/javascript) to sign in users:
```js
nhost.auth.signIn({
provider: 'twitch'
})
```

View File

@@ -17,13 +17,13 @@ Nhost Authentication support the following sign-in methods:
## 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.
## 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:
@@ -33,13 +33,24 @@ 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:
```js
nhost.auth.signIn({
provider: '<provider>'
options: {
redirectTo: "<host>/<slug>" // Example: "https://example.com/dashboard"
},
})
```
## Provider OAuth scopes
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

View File

@@ -7,9 +7,9 @@ image: /img/og/platform/cli.png
import Tabs from '@theme/Tabs'
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
- Hasura GraphQL API
@@ -55,31 +55,43 @@ Start by authenticating yourself to Nhost Cloud:
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
```
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
```
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
```
Then start the Nhost app locally:
Then start the Nhost project locally:
```
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 with the backend URL: `http://localhost:1337`.
## Subdomain and Region
Use `localhost:1337` as the `subdomain`, and skip `region` when using the CLI and the [JavaScript SDK](/reference/javascript):
```
import { NhostClient } from '@nhost/nhost-js'
const nhost = new NhostClient({
subdomain: 'localhost:1337',
})
```
## Emails

View File

@@ -7,7 +7,7 @@ image: /img/og/platform/database.png
import Tabs from '@theme/Tabs'
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
@@ -21,10 +21,10 @@ The database is managed via the Hasura Console where you can manage the database
Hasura Console is where you manage your database. This is where you create and manage tables, schemas, and data.
1) Open the Hasura Console by clicking on **GraphQL** in the top menu in the Nhost Dashboard.
2) Click **Open Hasura Console** at the top right of the page.
3) Copy the **admin secret**, and click **Open Hasura**.
4) Use the **admin secret** to sign in.
1. Open the Hasura Console by clicking on **GraphQL** in the top menu in the Nhost Dashboard.
2. Click **Open Hasura Console** at the top right of the page.
3. Copy the **admin secret**, and click **Open Hasura**.
4. Use the **admin secret** to sign in.
<video width="99%" autoPlay muted loop controls="true">
<source src="/videos/open-hasura-console.mp4" type="video/mp4" />
@@ -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.
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
@@ -131,6 +131,21 @@ To track database changes, use the [Nhost CLI](/platform/cli) to develop locally
Learn how to [get started with Nhost CLI](/platform/overview/get-started-with-nhost-cli).
## Seed Data
Seed data is a way of automatically adding data to your database using SQL when a new environment is created. This is, for the moment, only applicable when you're using the [Nhost CLI](/platform/cli) to develop locally. When you're running `nhost up` for the first time, seed data is added.
In the future, seed data will also be added to new preview environments.
Seed data should be located in `nhost/seeds/default/` and are executed in alphabetical order.
**Example:** Two seed scripts with countries and products.
```text
nhost/seeds/default/001-countries.sql
nhost/seeds/default/002-products.sql
```
## Backups
Databases on [Pro and Enterprise plans](https://nhost.io/pricing) are backed up automatically.

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.
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)
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:
@@ -19,7 +19,7 @@ Environment Variables are available in:
## 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_WEBHOOK_SECRET`
@@ -38,7 +38,7 @@ NHOST_BACKEND_URL=https://xxxxxxx.nhost.run
## 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.
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
---
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:
@@ -20,11 +20,11 @@ Settings in `nhost/config.yaml` are **not** deployed. That means you need to man
## 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)
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)
@@ -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`).
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>
<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
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>
<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
- 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).
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.
@@ -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.
:::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.
@@ -131,7 +131,7 @@ query GetTodosWithLatestComments {
A GraphQL mutation is used to insert, upsert, update, or delete data.
:::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

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.
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

View File

@@ -99,11 +99,11 @@ nhost logout
## 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
@@ -119,61 +119,43 @@ either public or private.
### 3. Connect Nhost project to Github
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
commits to your connected Git repository.
Finally, connect your GitHub repository to your Nhost project. Doing so will
enable Nhost to deploy new versions of your project when you push new 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)
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)
3. **Connect** your Github repository.
3. **Connect** your GitHub repository.
![Connect to GitHub](/img/architecture/cli/connect-repo-step-3.png)
## Develop locally
## 1. Initialize your Nhost app
## 1. Initialize your Nhost project
**Nhost CLI** brings the functionality of your Nhost production environment
directly to your local machine.
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.
You can either initialize a blank Nhost app locally to start from scratch by
running the following command:
Initialize your Nhost project locally with the following command:
```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
running the `link` command and selecting the corresponding app from the prompt:
It will prompt you to choose what Nhost project you want to initialize.
```bash
nhost link
```
![Select Nhost Project](/img/architecture/cli/cli-select-app.png)
Or you can directly initialize a local Nhost app from one of your existing
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.
Your file system will be populated with the following files and folders:
```
my-nhost-app/
@@ -200,11 +182,11 @@ git push -u origin main
## 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:
```bash
nhost dev
nhost up
```
:::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.
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.
It also runs a webserver to serve the Hasura Console for the GraphQL Engine so
you can manage the database and test the GraphQL API.
The Hasura console should open automatically at
[http://localhost:1337](http://localhost:1337/).
The Hasura Console opens automatically at [http://localhost:1337](http://localhost:1337/).
![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
to production:
- Database migrations
- Database Migrations
- Hasura Metadata
- 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.
:::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
@@ -250,14 +231,15 @@ To demonstrate how to make database changes, let's create a new table called
- `authorId` (type UUID),
- `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.
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)
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
`authorId` column to the `users.id` column using a foreign key to link the
`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
```
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.
To apply the local changes to production, check out the
@@ -338,12 +320,12 @@ insert_permissions:
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.
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.
First, make sure to install `express`, which is required for serverless

View File

@@ -11,7 +11,7 @@ import TabItem from '@theme/TabItem'
## 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:
- 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/)
- 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.
## 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
import CreateApp from '@site/src/components/create-nhost-app.mdx'
import CreateApp from '@site/src/components/create-nhost-project.mdx'
<CreateApp />
:::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
@@ -132,7 +132,8 @@ import { NhostNextProvider, NhostClient } from '@nhost/nextjs';
// highlight-start
const nhost = new NhostClient({
backendUrl: process.env.NEXT_PUBLIC_NHOST_BACKEND_URL || '',
subdomain: process.env.NEXT_PUBLIC_NHOST_SUBDOMAIN || '',
region: process.env.NEXT_PUBLIC_NHOST_REGION || ''
});
// highlight-end
@@ -149,16 +150,16 @@ function MyApp({ Component, pageProps }) {
}
```
Finally, make sure to create an environment variable named
`NEXT_PUBLIC_NHOST_BACKEND_URL` to store your Nhost backend URL:
Finally, store the environment variables for `subdomain` and `region` in `.env.development`:
```yaml title=".env.development"
NEXT_PUBLIC_NHOST_BACKEND_URL=YOUR_NHOST_BACKEND_URL
NEXT_PUBLIC_NHOST_SUBDOMAIN=[subdomain]
NEXT_PUBLIC_NHOST_REGION=[region]
```
You can find your Nhost backend URL for your project from [your dashboard](https://app.nhost.io) as shown below:
You find your Nhost project's `subdomain` and `region` in the [project overview](https://app.nhost.io):
![Nhost Backend URL](/img/quickstarts/app-dashboard.png)
![Project Overview](/img/quickstarts/app-dashboard.png)
:::caution
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
### 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
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
@@ -128,7 +128,8 @@ Nhost backend:
import { NhostClient, NhostReactProvider } from '@nhost/react'
const nhost = new NhostClient({
backendUrl: process.env.REACT_APP_NHOST_BACKEND_URL || ''
subdomain: process.env.REACT_APP_NHOST_SUBDOMAIN,
region: process.env.REACT_APP_NHOST_REGION
})
function App() {
@@ -143,15 +144,16 @@ export default App
```
Finally, make sure to create an environment variable named
`REACT_APP_NHOST_BACKEND_URL` to store your Nhost backend URL:
`REACT_APP_NHOST_SUBDOMAIN` and `REACT_APP_NHOST_REGION` to store your Nhost domain details:
```yaml title=".env.local"
REACT_APP_NHOST_BACKEND_URL=YOUR_NHOST_BACKEND_URL
REACT_APP_NHOST_SUBDOMAIN=[subdomain]
REACT_APP_NHOST_REGION=[region]
```
You can find your Nhost backend URL for your project from [your dashboard](https://app.nhost.io) as shown below:
You find your Nhost project's `subdomain` and `region` in the [project overview](https://app.nhost.io):
![Nhost Backend URL](/img/quickstarts/app-dashboard.png)
![Project Overview](/img/quickstarts/app-dashboard.png)
:::caution
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
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**
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.
<CreateApp />
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)
:::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
@@ -136,7 +125,8 @@ import { NhostClient } from '@nhost/nhost-js'
// highlight-start
const nhostClient = new NhostClient({
backendUrl: process.env.NHOST_BACKEND_URL
subdomain: process.env.NHOST_SUBDOMAIN
region: process.env.NHOST_REGION
})
// highlight-end
@@ -175,16 +165,16 @@ const App = () => (
That prop avoids having an additional request to fetch the current user.
Next, make sure to create an environment variable named
`NHOST_BACKEND_URL` to store your Nhost backend URL:
Next, store the environment variables for `subdomain` and `region` in `.env`:
```yaml title=".env"
NHOST_BACKEND_URL=YOUR_NHOST_BACKEND_URL
NHOST_SUBDOMAIN=[subdomain]
NHOST_REGION=[region]
```
You can find your Nhost backend URL for your project from [your dashboard](https://app.nhost.io) as shown below:
You find your Nhost project's `subdomain` and `region` in the [project overview](https://app.nhost.io):
![Nhost Backend URL](/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.
@@ -194,7 +184,7 @@ So, open the RedwoodJS configuration file, `redwood.toml`, and change the GraphQ
[web]
apiUrl = "/.redwood/functions"
# highlight-next-line
apiGraphQLUrl = "${NHOST_BACKEND_URL}/v1/graphql"
apiGraphQLUrl = "https://${NHOST_SUBDOMAIN}.graphql.${NHOST_REGION}.nhost.run/v1"
```
:::caution

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
import CreateApp from '@site/src/components/create-nhost-app.mdx'
import CreateApp from '@site/src/components/create-nhost-project.mdx'
<CreateApp />
:::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
@@ -153,7 +153,8 @@ import 'uno.css'
// highlight-start
const nhost = new NhostClient({
backendUrl: import.meta.env.VITE_NHOST_URL
subdomain: import.meta.env.VITE_NHOST_SUBDOMAIN
region: import.meta.env.VITE_NHOST_REGION
})
// highlight-end
@@ -170,16 +171,16 @@ app
app.mount('#app')
```
Finally, make sure to create an environment variable named
`VITE_NHOST_URL` to store your Nhost backend URL:
Finally, store the environment variables for `subdomain` and `region` in `.env`:
```bash title=".env"
VITE_NHOST_URL=YOUR_NHOST_BACKEND_URL
```yaml title=".env.development"
VITE_NHOST_SUBDOMAIN=[subdomain]
VITE_NHOST_REGION=[region]
```
You can find your Nhost backend URL for your project from [your dashboard](https://app.nhost.io) as shown below:
You find your Nhost project's `subdomain` and `region` in the [project overview](https://app.nhost.io):
![Nhost Backend URL](/img/quickstarts/app-dashboard.png)
![Project Overview](/img/quickstarts/app-dashboard.png)
## 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
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">
<TabItem value="ts" label="TypeScript" default>
@@ -30,7 +30,7 @@ export default (req: Request, res: Response) => {
:::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
npm install -d express @types/express
@@ -51,7 +51,7 @@ export default (req, res) => {
:::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
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:
| File | HTTP Endpoint |
| --------------------------- | ------------------------------------------------------------- |
| `functions/index.js` | `https://[app-subdomain].nhost.run/v1/functions/` |
| `functions/users/index.ts` | `https://[app-subdomain].nhost.run/v1/functions/users` |
| `functions/users/active.ts` | `https://[app-subdomain].nhost.run/v1/functions/users/active` |
| `functions/my-company.js` | `https://[app-subdomain].nhost.run/v1/functions/my-company` |
| File | HTTP Endpoint |
| --------------------------- | ----------------------------------------------------------------- |
| `functions/index.js` | `https://[project-subdomain].nhost.run/v1/functions/` |
| `functions/users/index.ts` | `https://[project-subdomain].nhost.run/v1/functions/users` |
| `functions/users/active.ts` | `https://[project-subdomain].nhost.run/v1/functions/users/active` |
| `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
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.
:::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
@@ -28,8 +28,8 @@ You're allowed to add and modify the following:
- GraphQL Relationships
- Permissions
:::
:::
### Upload File
@@ -159,16 +159,11 @@ Permissions to upload, download, and delete files are managed through Hasura's p
### 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:
- `id`
- `bucket_id`
- `name`
- `mime_type`
To upload a file, a user must have the **`insert` permission** to the `storage.files` table. The `id` column must be granted.
### 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
@@ -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:
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
- id
- name
- address
customer_files
- id
- customer_id (Foreign Key to `customers.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:
```graphql
query {
customers { # customers table
customers {
# customers table
id
name
customer_files { # customer_files tabel
customer_files {
# customer_files table
id
file { # storage.files table
file {
# storage.files table
id
name
size
@@ -239,6 +238,6 @@ The file upload process would be as follows:
1. Upload a file.
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
---
Intialize a local Nhost app in the current working directory.
Intialize a local Nhost project in the current working directory.
```
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

View File

@@ -3,7 +3,7 @@ title: 'link'
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
nhost link

View File

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

View File

@@ -3,11 +3,11 @@ title: 'up'
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 the Hasura metadata.
- Apply seed data.
- Apply [seed data](/platform/database#seed-data).
```bash
nhost up

View File

@@ -53,8 +53,8 @@ nhost.auth.signIn({ email: 'joe@example.com' })
```ts
// [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)
nhost.auth.signIn({ phoneNumber: '001122334455', otp: '123456' })
nhost.auth.signIn({ phoneNumber: '+11233213123', otp: '123456' })
```

View File

@@ -31,7 +31,7 @@ nhost.auth.signOut()
nhost.auth.signOut()
```
### Sign out the user from all decvices
### Sign out the user from all devices
```ts
nhost.auth.signOut({ all: true })

View File

@@ -3,13 +3,13 @@
title: changePassword()
sidebar_label: changePassword()
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
---
# `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
nhost.auth.changePassword({ newPassword: 'new-secret-password' })
@@ -24,5 +24,6 @@ nhost.auth.changePassword({ newPassword: 'new-secret-password' })
| 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>ticket</span> | `string` | | |
---

View File

@@ -4,7 +4,7 @@ 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
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L182
---
# `ApiChangeEmailResponse`

View File

@@ -4,7 +4,7 @@ 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
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L174
---
# `ApiChangePasswordResponse`

View File

@@ -4,7 +4,7 @@ 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
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L186
---
# `ApiDeanonymizeResponse`

View File

@@ -4,7 +4,7 @@ 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
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L162
---
# `ApiRefreshTokenResponse`

View File

@@ -4,7 +4,7 @@ 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
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L170
---
# `ApiResetPasswordResponse`

View File

@@ -4,7 +4,7 @@ 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
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L178
---
# `ApiSendVerificationEmailResponse`

View File

@@ -4,7 +4,7 @@ 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
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L151
---
# `ApiSignInData`

View File

@@ -4,7 +4,7 @@ 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
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L155
---
# `ApiSignInResponse`

View File

@@ -4,7 +4,7 @@ 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
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L166
---
# `ApiSignOutResponse`

View File

@@ -4,7 +4,7 @@ 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
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L147
---
# `ApiSignUpEmailPasswordResponse`

View File

@@ -4,7 +4,7 @@ title: AuthChangeEvent
sidebar_label: AuthChangeEvent
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#L134
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L135
---
# `AuthChangeEvent`

View File

@@ -4,7 +4,7 @@ title: AuthChangedFunction
sidebar_label: AuthChangedFunction
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#L136
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L137
---
# `AuthChangedFunction`

View File

@@ -4,7 +4,7 @@ title: ChangeEmailParams
sidebar_label: ChangeEmailParams
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#L105
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L106
---
# `ChangeEmailParams`

View File

@@ -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">ticket</span>** <span className="optional-status">optional</span> `string`
---

View File

@@ -4,7 +4,7 @@ title: DeanonymizeParams
sidebar_label: DeanonymizeParams
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#L110
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L111
---
# `DeanonymizeParams`

View File

@@ -4,7 +4,7 @@ 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
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L140
---
# `Headers`

View File

@@ -4,7 +4,7 @@ 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
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L143
---
# `Mfa`

View File

@@ -4,7 +4,7 @@ title: OnTokenChangedFunction
sidebar_label: OnTokenChangedFunction
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#L138
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L139
---
# `OnTokenChangedFunction`

View File

@@ -22,4 +22,6 @@ type Provider =
| 'strava'
| 'gitlab'
| 'bitbucket'
| 'discord'
| 'twitch'
```

View File

@@ -4,7 +4,7 @@ title: SendVerificationEmailParams
sidebar_label: SendVerificationEmailParams
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#L100
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L101
---
# `SendVerificationEmailParams`

View File

@@ -4,7 +4,7 @@ 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
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L124
---
# `SignInReponse`

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)
| 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>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>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>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>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>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>region</span> | `string` | | App region (e.g., eu-central-1) Not required in development (when `subdomain` is "localhost") |
| 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>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>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>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>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 Serverless Functions. |
| <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` | | 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)
| 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>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>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>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>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>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>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 |
| Property | Type | Required | Notes |
| :------------------------------------------------------------------------------------------------------------------ | :------------------ | :------: | :--------------------------------------------------------------------------------------------------------------------------------------- |
| <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` | | 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 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>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>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>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>refreshIntervalTime</span> | `number` | | Time interval until token refreshes, in seconds |
---

View File

@@ -3,13 +3,13 @@
title: request()
sidebar_label: 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
---
# `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
const CUSTOMERS = gql`

View File

@@ -4,7 +4,7 @@ title: BackendOrSubdomain
sidebar_label: BackendOrSubdomain
description: No description provided.
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`

View File

@@ -4,7 +4,7 @@ title: FunctionCallResponse
sidebar_label: FunctionCallResponse
description: No description provided.
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`

View File

@@ -4,7 +4,7 @@ title: GraphqlRequestResponse
sidebar_label: GraphqlRequestResponse
description: No description provided.
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`

View File

@@ -4,7 +4,7 @@ title: GraphqlResponse
sidebar_label: GraphqlResponse
description: No description provided.
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`

View File

@@ -4,7 +4,7 @@ title: NhostClientConstructorParams
sidebar_label: NhostClientConstructorParams
description: No description provided.
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`
@@ -79,21 +79,20 @@ Should only be used when self-hosting
**<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`,
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`
App subdomain (e.g, ieingiwnginwnfnegqwvdqwdwq)
Should be used when using the Nhost platform
Use "localhost" in development
Project subdomain (e.g. `ieingiwnginwnfnegqwvdqwdwq`)
Use `localhost` during local development
---
**<span className="parameter-name">region</span>** <span className="optional-status">optional</span> `string`
App region (e.g., eu-central-1)
Not required in development (when `subdomain` is "localhost")
Project region (e.g. `eu-central-1`)
Project region is not required during local development (when `subdomain` is `localhost`)
---

View File

@@ -4,7 +4,7 @@ title: createMultipleFilesUploadMachine()
sidebar_label: createMultipleFilesUploadMachine()
slug: /reference/javascript/storage/create-multiple-files-upload-machine
description: No description provided.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-storage-js/src/packages/hasura-storage-js/src/machines/multiple-files-upload.ts#L28
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-storage-js/src/packages/hasura-storage-js/src/machines/multiple-files-upload.ts#L37
---
# `createMultipleFilesUploadMachine()`

View File

@@ -27,6 +27,6 @@ custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-storag
---
**<span className="parameter-name">\_\_namedParameters</span>** <span className="optional-status">required</span> `Partial<StorageUploadParams>`
**<span className="parameter-name">params</span>** <span className="optional-status">required</span> `Partial<StorageUploadParams>`
---

View File

@@ -4,7 +4,7 @@ title: uploadMultipleFilesPromise()
sidebar_label: uploadMultipleFilesPromise()
slug: /reference/javascript/storage/upload-multiple-files-promise
description: No description provided.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-storage-js/src/packages/hasura-storage-js/src/promises/multiple-files-upload.ts#L45
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-storage-js/src/packages/hasura-storage-js/src/promises/multiple-files-upload.ts#L46
---
# `uploadMultipleFilesPromise()`
@@ -23,14 +23,15 @@ custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-storag
---
**<span className="parameter-name">service</span>** <span className="optional-status">required</span> `Interpreter<MultipleFilesUploadContext, any, { type: "ADD", files: File | Array<File> } | { type: "UPLOAD", url: string, bucketId: string, accessToken: string, adminSecret: string } | { type: "UPLOAD_PROGRESS", additions: number } | { type: "UPLOAD_DONE" } | { type: "UPLOAD_ERROR" } | { type: "CANCEL" } | { type: "REMOVE" } | { type: "CLEAR" }, { value: any, context: MultipleFilesUploadContext }, ResolveTypegenMeta<Typegen0, { type: "ADD", files: File | Array<File> } | { type: "UPLOAD", url: string, bucketId: string, accessToken: string, adminSecret: string } | { type: "UPLOAD_PROGRESS", additions: number } | { type: "UPLOAD_DONE" } | { type: "UPLOAD_ERROR" } | { type: "CANCEL" } | { type: "REMOVE" } | { type: "CLEAR" }, BaseActionObject, ServiceMap>>`
**<span className="parameter-name">service</span>** <span className="optional-status">required</span> `Interpreter<MultipleFilesUploadContext, any, { type: "ADD", files: AnyFileList, bucketId: string } | { type: "UPLOAD", url: string, files: AnyFileList, bucketId: string, accessToken: string, adminSecret: string } | { type: "UPLOAD_PROGRESS", additions: number } | { type: "UPLOAD_DONE" } | { type: "UPLOAD_ERROR" } | { type: "CANCEL" } | { type: "REMOVE" } | { type: "CLEAR" }, { value: any, context: MultipleFilesUploadContext }, ResolveTypegenMeta<Typegen0, { type: "ADD", files: AnyFileList, bucketId: string } | { type: "UPLOAD", url: string, files: AnyFileList, bucketId: string, accessToken: string, adminSecret: string } | { type: "UPLOAD_PROGRESS", additions: number } | { type: "UPLOAD_DONE" } | { type: "UPLOAD_ERROR" } | { type: "CANCEL" } | { type: "REMOVE" } | { type: "CLEAR" }, BaseActionObject, ServiceMap>>`
---
**<span className="parameter-name">options</span>** <span className="optional-status">required</span> [`UploadMultipleFilesActionParams`](/reference/docgen/javascript/storage/types/upload-multiple-files-action-params)
**<span className="parameter-name">params</span>** <span className="optional-status">optional</span> [`UploadMultipleFilesActionParams`](/reference/docgen/javascript/storage/types/upload-multiple-files-action-params)
| Property | Type | Required | Notes |
| :------------------------------------------------------------------------------------------- | :------- | :------: | :---- |
| <span className="parameter-name"><span className="light-grey">options.</span>bucketId</span> | `string` | | |
| Property | Type | Required | Notes |
| :------------------------------------------------------------------------------------------ | :------------------------------------------------------------------------ | :------: | :---- |
| <span className="parameter-name"><span className="light-grey">params.</span>bucketId</span> | `string` | | |
| <span className="parameter-name"><span className="light-grey">params.</span>files</span> | [`AnyFileList`](/reference/docgen/javascript/storage/types/any-file-list) | | |
---

View File

@@ -0,0 +1,14 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: AnyFileList
sidebar_label: AnyFileList
description: No description provided.
displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-storage-js/src/packages/hasura-storage-js/src/machines/multiple-files-upload.ts#L9
---
# `AnyFileList`
```ts
type AnyFileList = File | Array<File> | FileList
```

View File

@@ -4,7 +4,7 @@ title: MultipleFilesUploadContext
sidebar_label: MultipleFilesUploadContext
description: No description provided.
displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-storage-js/src/packages/hasura-storage-js/src/machines/multiple-files-upload.ts#L9
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-storage-js/src/packages/hasura-storage-js/src/machines/multiple-files-upload.ts#L11
---
# `MultipleFilesUploadContext`

View File

@@ -4,17 +4,18 @@ title: MultipleFilesUploadEvents
sidebar_label: MultipleFilesUploadEvents
description: No description provided.
displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-storage-js/src/packages/hasura-storage-js/src/machines/multiple-files-upload.ts#L16
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-storage-js/src/packages/hasura-storage-js/src/machines/multiple-files-upload.ts#L18
---
# `MultipleFilesUploadEvents`
```ts
type MultipleFilesUploadEvents =
| { type: 'ADD'; files: File | Array<File> }
| { type: 'ADD'; files: AnyFileList; bucketId: string }
| {
type: 'UPLOAD'
url: string
files: AnyFileList
bucketId: string
accessToken: string
adminSecret: string

View File

@@ -4,7 +4,7 @@ title: MultipleFilesUploadMachine
sidebar_label: MultipleFilesUploadMachine
description: No description provided.
displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-storage-js/src/packages/hasura-storage-js/src/machines/multiple-files-upload.ts#L26
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-storage-js/src/packages/hasura-storage-js/src/machines/multiple-files-upload.ts#L35
---
# `MultipleFilesUploadMachine`

View File

@@ -10,5 +10,5 @@ custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-storag
# `UploadMultipleFilesActionParams`
```ts
type UploadMultipleFilesActionParams = () => { bucketId: string }
type UploadMultipleFilesActionParams = () => { bucketId: string, files: [AnyFileList](/reference/docgen/javascript/storage/types/any-file-list) }
```

View File

@@ -15,15 +15,15 @@ custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/nextjs/src/in
**<span className="parameter-name">params</span>** <span className="optional-status">required</span> [`NhostNextClientConstructorParams`](/reference/docgen/nextjs/types/nhost-next-client-constructor-params)
| Property | Type | Required | Notes |
| :----------------------------------------------------------------------------------------------------- | :-------- | :------: | :---------------------------------------------------------------------------------------------------------------------------- |
| <span className="parameter-name"><span className="light-grey">params.</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">params.</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">params.</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">params.</span>backendUrl</span> | `string` | | Nhost backend URL Should only be used when self-hosting |
| <span className="parameter-name"><span className="light-grey">params.</span>devTools</span> | `boolean` | | Activate devTools e.g. the ability to connect to the xstate inspector |
| <span className="parameter-name"><span className="light-grey">params.</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">params.</span>autoRefreshToken</span> | `boolean` | | When set to true, will automatically refresh token before it expires |
| <span className="parameter-name"><span className="light-grey">params.</span>refreshIntervalTime</span> | `number` | | Time interval until token refreshes, in seconds |
| Property | Type | Required | Notes |
| :----------------------------------------------------------------------------------------------------- | :-------- | :------: | :--------------------------------------------------------------------------------------------------------------------------------------- |
| <span className="parameter-name"><span className="light-grey">params.</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">params.</span>subdomain</span> | `string` | | Project subdomain (e.g. `ieingiwnginwnfnegqwvdqwdwq`) Use `localhost` during local development |
| <span className="parameter-name"><span className="light-grey">params.</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">params.</span>backendUrl</span> | `string` | | Nhost backend URL Should only be used when self-hosting |
| <span className="parameter-name"><span className="light-grey">params.</span>devTools</span> | `boolean` | | Activate devTools e.g. the ability to connect to the xstate inspector |
| <span className="parameter-name"><span className="light-grey">params.</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">params.</span>autoRefreshToken</span> | `boolean` | | When set to true, will automatically refresh token before it expires |
| <span className="parameter-name"><span className="light-grey">params.</span>refreshIntervalTime</span> | `number` | | Time interval until token refreshes, in seconds |
---

View File

@@ -4,7 +4,7 @@ title: useFileUploadItem()
sidebar_label: useFileUploadItem()
slug: /reference/nextjs/use-file-upload-item
description: Use the hook `useFileUploadItem` to control the file upload of a file in a multiple file upload.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/react/src/useFileUpload.ts#L59
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/react/src/useFileUpload.ts#L61
---
# `useFileUploadItem()`

View File

@@ -4,7 +4,7 @@ title: useFileUpload()
sidebar_label: useFileUpload()
slug: /reference/nextjs/use-file-upload
description: Use the hook `useFileUpload` to upload a file.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/react/src/useFileUpload.ts#L129
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/react/src/useFileUpload.ts#L142
---
# `useFileUpload()`

View File

@@ -4,7 +4,7 @@ title: useMultipleFilesUpload()
sidebar_label: useMultipleFilesUpload()
slug: /reference/nextjs/use-multiple-files-upload
description: Use the hook `useFileUpload` to upload multiple files.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/react/src/useMultipleFilesUpload.ts#L52
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/react/src/useMultipleFilesUpload.ts#L55
---
# `useMultipleFilesUpload()`

View File

@@ -0,0 +1,50 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: useSignInSmsPasswordless()
sidebar_label: useSignInSmsPasswordless()
slug: /reference/nextjs/use-sign-in-sms-passwordless
description: Use the hook `useSignInSmsPasswordless` to sign in a user with a one-time password sent via SMS to a phone.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/react/src/useSignInSmsPasswordless.ts#L57
---
# `useSignInSmsPasswordless()`
Use the hook `useSignInSmsPasswordless` to sign in a user with a one-time password sent via SMS to a phone.
1. The `signInSmsPasswordless` action sends a one-time password to the given phone number.
2. The client is then awaiting the OTP. `needsOtp` equals true.
3. After the code is received by SMS, the client sends the code with `sendOtp`. On success, the client is authenticated, and `isSuccess` equals `true`.
Any error is monitored through `isError` and `error`. While the `signInSmsPasswordless` and `sendOtp` actions are running, `isLoading` equals `true`.
```tsx
const {
signInSmsPasswordless,
sendOtp,
needsOtp,
isLoading,
isSuccess,
isError,
error
} = useSignInSmsPasswordless()
console.log({ isLoading, isSuccess, isError, error })
const askCode = async (e) => {
e.preventDefault()
await signInSmsPasswordless('+32455555555')
}
const sendCode = async (e) => {
e.preventDefault()
await sendOtp('123456')
}
```
## Parameters
---
**<span className="parameter-name">stateOptions</span>** <span className="optional-status">optional</span> `PasswordlessOptions`
---

View File

@@ -4,7 +4,7 @@ title: FileUploadHookResult
sidebar_label: FileUploadHookResult
description: No description provided.
displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/react/src/useFileUpload.ts#L14
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/react/src/useFileUpload.ts#L16
---
# `FileUploadHookResult`
@@ -67,11 +67,11 @@ Returns the name of the file.
---
**<span className="parameter-name">add</span>** <span className="optional-status">required</span> `(file: File) => void`
**<span className="parameter-name">add</span>** <span className="optional-status">required</span> `(params: StorageUploadParams) => void`
---
**<span className="parameter-name">upload</span>** <span className="optional-status">required</span> `(file: File) => Promise<UploadFileHandlerResult>`
**<span className="parameter-name">upload</span>** <span className="optional-status">required</span> `(params: Partial<StorageUploadParams>) => Promise<UploadFileHandlerResult>`
---

View File

@@ -49,11 +49,11 @@ Returns `true` when all the files have been successfully uploaded.
---
**<span className="parameter-name">add</span>** <span className="optional-status">required</span> `(files: Array<File>) => void`
**<span className="parameter-name">add</span>** <span className="optional-status">required</span> `(params: Required<Pick<UploadMultipleFilesActionParams, "files">> & UploadMultipleFilesActionParams) => void`
---
**<span className="parameter-name">upload</span>** <span className="optional-status">required</span> `(options: UploadMultipleFilesActionParams) => Promise<MultipleFilesHandlerResult>`
**<span className="parameter-name">upload</span>** <span className="optional-status">required</span> `(params: UploadMultipleFilesActionParams) => Promise<MultipleFilesHandlerResult>`
---

View File

@@ -15,23 +15,22 @@ custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/nextjs/src/in
**<span className="parameter-name">region</span>** <span className="optional-status">optional</span> `string`
App region (e.g., eu-central-1)
Not required in development (when `subdomain` is "localhost")
Project region (e.g. `eu-central-1`)
Project region is not required during local development (when `subdomain` is `localhost`)
---
**<span className="parameter-name">subdomain</span>** <span className="optional-status">optional</span> `string`
App subdomain (e.g, ieingiwnginwnfnegqwvdqwdwq)
Should be used when using the Nhost platform
Use "localhost" in development
Project subdomain (e.g. `ieingiwnginwnfnegqwvdqwdwq`)
Use `localhost` during local development
---
**<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`,
for all requests to GraphQL, Storage, and Functions.
for all requests to GraphQL, Storage, and Serverless Functions.
---

View File

@@ -75,21 +75,20 @@ Should only be used when self-hosting
**<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`,
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`
App subdomain (e.g, ieingiwnginwnfnegqwvdqwdwq)
Should be used when using the Nhost platform
Use "localhost" in development
Project subdomain (e.g. `ieingiwnginwnfnegqwvdqwdwq`)
Use `localhost` during local development
---
**<span className="parameter-name">region</span>** <span className="optional-status">optional</span> `string`
App region (e.g., eu-central-1)
Not required in development (when `subdomain` is "localhost")
Project region (e.g. `eu-central-1`)
Project region is not required during local development (when `subdomain` is `localhost`)
---

View File

@@ -0,0 +1,10 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: SignInSmsPasswordlessHandler
sidebar_label: SignInSmsPasswordlessHandler
description: No description provided.
displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/react/src/useSignInSmsPasswordless.ts#L14
---
# `SignInSmsPasswordlessHandler`

View File

@@ -0,0 +1,62 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: SignInSmsPasswordlessHookResult
sidebar_label: SignInSmsPasswordlessHookResult
description: No description provided.
displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/react/src/useSignInSmsPasswordless.ts#L23
---
# `SignInSmsPasswordlessHookResult`
## Parameters
---
**<span className="parameter-name">needsOtp</span>** <span className="optional-status">required</span> `boolean`
Returns true when the one-time password has been sent over by SMS, and the user needs to send it back to complete sign-in.
---
**<span className="parameter-name">isError</span>** <span className="optional-status">required</span> `boolean`
**`@returns`**
`true` if an error occurred
**`@depreacted`**
use `!isSuccess` or `!!error` instead
---
**<span className="parameter-name">error</span>** <span className="optional-status">required</span> `null` | `ErrorPayload`
Provides details about the error
---
**<span className="parameter-name">isLoading</span>** <span className="optional-status">required</span> `boolean`
**`@returns`**
`true` when the action is executing, `false` when it finished its execution.
---
**<span className="parameter-name">isSuccess</span>** <span className="optional-status">required</span> `boolean`
Returns `true` if the action is successful.
---
**<span className="parameter-name">signInSmsPasswordless</span>** <span className="optional-status">required</span> [`SignInSmsPasswordlessHandler`](/reference/docgen/nextjs/types/sign-in-sms-passwordless-handler)
Sends a one-time code to the given phoneNumber
---
**<span className="parameter-name">sendOtp</span>** <span className="optional-status">required</span> [`SignInSmsPasswordlessOtpHandler`](/reference/docgen/nextjs/types/sign-in-sms-passwordless-otp-handler)
---

View File

@@ -0,0 +1,10 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: SignInSmsPasswordlessOtpHandler
sidebar_label: SignInSmsPasswordlessOtpHandler
description: No description provided.
displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/react/src/useSignInSmsPasswordless.ts#L18
---
# `SignInSmsPasswordlessOtpHandler`

View File

@@ -15,17 +15,17 @@ custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/react/src/cli
**<span className="parameter-name">params</span>** <span className="optional-status">required</span> [`NhostReactClientConstructorParams`](/reference/docgen/react/types/nhost-react-client-constructor-params)
| Property | Type | Required | Notes |
| :----------------------------------------------------------------------------------------------------- | :------------------ | :------: | :---------------------------------------------------------------------------------------------------------------------------- |
| <span className="parameter-name"><span className="light-grey">params.</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">params.</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">params.</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">params.</span>backendUrl</span> | `string` | | Nhost backend URL Should only be used when self-hosting |
| <span className="parameter-name"><span className="light-grey">params.</span>devTools</span> | `boolean` | | Activate devTools e.g. the ability to connect to the xstate inspector |
| <span className="parameter-name"><span className="light-grey">params.</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">params.</span>autoRefreshToken</span> | `boolean` | | When set to true, will automatically refresh token before it expires |
| <span className="parameter-name"><span className="light-grey">params.</span>clientStorage</span> | `ClientStorage` | | Object where the refresh token will be persisted and read locally. |
| <span className="parameter-name"><span className="light-grey">params.</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">params.</span>refreshIntervalTime</span> | `number` | | Time interval until token refreshes, in seconds |
| Property | Type | Required | Notes |
| :----------------------------------------------------------------------------------------------------- | :------------------ | :------: | :--------------------------------------------------------------------------------------------------------------------------------------- |
| <span className="parameter-name"><span className="light-grey">params.</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">params.</span>subdomain</span> | `string` | | Project subdomain (e.g. `ieingiwnginwnfnegqwvdqwdwq`) Use `localhost` during local development |
| <span className="parameter-name"><span className="light-grey">params.</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">params.</span>backendUrl</span> | `string` | | Nhost backend URL Should only be used when self-hosting |
| <span className="parameter-name"><span className="light-grey">params.</span>devTools</span> | `boolean` | | Activate devTools e.g. the ability to connect to the xstate inspector |
| <span className="parameter-name"><span className="light-grey">params.</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">params.</span>autoRefreshToken</span> | `boolean` | | When set to true, will automatically refresh token before it expires |
| <span className="parameter-name"><span className="light-grey">params.</span>clientStorage</span> | `ClientStorage` | | Object where the refresh token will be persisted and read locally. |
| <span className="parameter-name"><span className="light-grey">params.</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">params.</span>refreshIntervalTime</span> | `number` | | Time interval until token refreshes, in seconds |
---

View File

@@ -4,7 +4,7 @@ title: useFileUploadItem()
sidebar_label: useFileUploadItem()
slug: /reference/react/use-file-upload-item
description: Use the hook `useFileUploadItem` to control the file upload of a file in a multiple file upload.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/react/src/useFileUpload.ts#L59
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/react/src/useFileUpload.ts#L61
---
# `useFileUploadItem()`

View File

@@ -4,7 +4,7 @@ title: useFileUpload()
sidebar_label: useFileUpload()
slug: /reference/react/use-file-upload
description: Use the hook `useFileUpload` to upload a file.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/react/src/useFileUpload.ts#L129
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/react/src/useFileUpload.ts#L142
---
# `useFileUpload()`

View File

@@ -4,7 +4,7 @@ title: useMultipleFilesUpload()
sidebar_label: useMultipleFilesUpload()
slug: /reference/react/use-multiple-files-upload
description: Use the hook `useFileUpload` to upload multiple files.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/react/src/useMultipleFilesUpload.ts#L52
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/react/src/useMultipleFilesUpload.ts#L55
---
# `useMultipleFilesUpload()`

View File

@@ -0,0 +1,50 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: useSignInSmsPasswordless()
sidebar_label: useSignInSmsPasswordless()
slug: /reference/react/use-sign-in-sms-passwordless
description: Use the hook `useSignInSmsPasswordless` to sign in a user with a one-time password sent via SMS to a phone.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/react/src/useSignInSmsPasswordless.ts#L57
---
# `useSignInSmsPasswordless()`
Use the hook `useSignInSmsPasswordless` to sign in a user with a one-time password sent via SMS to a phone.
1. The `signInSmsPasswordless` action sends a one-time password to the given phone number.
2. The client is then awaiting the OTP. `needsOtp` equals true.
3. After the code is received by SMS, the client sends the code with `sendOtp`. On success, the client is authenticated, and `isSuccess` equals `true`.
Any error is monitored through `isError` and `error`. While the `signInSmsPasswordless` and `sendOtp` actions are running, `isLoading` equals `true`.
```tsx
const {
signInSmsPasswordless,
sendOtp,
needsOtp,
isLoading,
isSuccess,
isError,
error
} = useSignInSmsPasswordless()
console.log({ isLoading, isSuccess, isError, error })
const askCode = async (e) => {
e.preventDefault()
await signInSmsPasswordless('+32455555555')
}
const sendCode = async (e) => {
e.preventDefault()
await sendOtp('123456')
}
```
## Parameters
---
**<span className="parameter-name">stateOptions</span>** <span className="optional-status">optional</span> `PasswordlessOptions`
---

View File

@@ -4,7 +4,7 @@ title: FileUploadHookResult
sidebar_label: FileUploadHookResult
description: No description provided.
displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/react/src/useFileUpload.ts#L14
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/react/src/useFileUpload.ts#L16
---
# `FileUploadHookResult`
@@ -67,11 +67,11 @@ Returns the name of the file.
---
**<span className="parameter-name">add</span>** <span className="optional-status">required</span> `(file: File) => void`
**<span className="parameter-name">add</span>** <span className="optional-status">required</span> `(params: StorageUploadParams) => void`
---
**<span className="parameter-name">upload</span>** <span className="optional-status">required</span> `(file: File) => Promise<UploadFileHandlerResult>`
**<span className="parameter-name">upload</span>** <span className="optional-status">required</span> `(params: Partial<StorageUploadParams>) => Promise<UploadFileHandlerResult>`
---

View File

@@ -49,11 +49,11 @@ Returns `true` when all the files have been successfully uploaded.
---
**<span className="parameter-name">add</span>** <span className="optional-status">required</span> `(files: Array<File>) => void`
**<span className="parameter-name">add</span>** <span className="optional-status">required</span> `(params: Required<Pick<UploadMultipleFilesActionParams, "files">> & UploadMultipleFilesActionParams) => void`
---
**<span className="parameter-name">upload</span>** <span className="optional-status">required</span> `(options: UploadMultipleFilesActionParams) => Promise<MultipleFilesHandlerResult>`
**<span className="parameter-name">upload</span>** <span className="optional-status">required</span> `(params: UploadMultipleFilesActionParams) => Promise<MultipleFilesHandlerResult>`
---

View File

@@ -15,23 +15,22 @@ custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/react/src/cli
**<span className="parameter-name">region</span>** <span className="optional-status">optional</span> `string`
App region (e.g., eu-central-1)
Not required in development (when `subdomain` is "localhost")
Project region (e.g. `eu-central-1`)
Project region is not required during local development (when `subdomain` is `localhost`)
---
**<span className="parameter-name">subdomain</span>** <span className="optional-status">optional</span> `string`
App subdomain (e.g, ieingiwnginwnfnegqwvdqwdwq)
Should be used when using the Nhost platform
Use "localhost" in development
Project subdomain (e.g. `ieingiwnginwnfnegqwvdqwdwq`)
Use `localhost` during local development
---
**<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`,
for all requests to GraphQL, Storage, and Functions.
for all requests to GraphQL, Storage, and Serverless Functions.
---

View File

@@ -0,0 +1,10 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: SignInSmsPasswordlessHandler
sidebar_label: SignInSmsPasswordlessHandler
description: No description provided.
displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/react/src/useSignInSmsPasswordless.ts#L14
---
# `SignInSmsPasswordlessHandler`

View File

@@ -0,0 +1,62 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: SignInSmsPasswordlessHookResult
sidebar_label: SignInSmsPasswordlessHookResult
description: No description provided.
displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/react/src/useSignInSmsPasswordless.ts#L23
---
# `SignInSmsPasswordlessHookResult`
## Parameters
---
**<span className="parameter-name">needsOtp</span>** <span className="optional-status">required</span> `boolean`
Returns true when the one-time password has been sent over by SMS, and the user needs to send it back to complete sign-in.
---
**<span className="parameter-name">isError</span>** <span className="optional-status">required</span> `boolean`
**`@returns`**
`true` if an error occurred
**`@depreacted`**
use `!isSuccess` or `!!error` instead
---
**<span className="parameter-name">error</span>** <span className="optional-status">required</span> `null` | `ErrorPayload`
Provides details about the error
---
**<span className="parameter-name">isLoading</span>** <span className="optional-status">required</span> `boolean`
**`@returns`**
`true` when the action is executing, `false` when it finished its execution.
---
**<span className="parameter-name">isSuccess</span>** <span className="optional-status">required</span> `boolean`
Returns `true` if the action is successful.
---
**<span className="parameter-name">signInSmsPasswordless</span>** <span className="optional-status">required</span> [`SignInSmsPasswordlessHandler`](/reference/docgen/react/types/sign-in-sms-passwordless-handler)
Sends a one-time code to the given phoneNumber
---
**<span className="parameter-name">sendOtp</span>** <span className="optional-status">required</span> [`SignInSmsPasswordlessOtpHandler`](/reference/docgen/react/types/sign-in-sms-passwordless-otp-handler)
---

View File

@@ -0,0 +1,10 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: SignInSmsPasswordlessOtpHandler
sidebar_label: SignInSmsPasswordlessOtpHandler
description: No description provided.
displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/react/src/useSignInSmsPasswordless.ts#L18
---
# `SignInSmsPasswordlessOtpHandler`

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