Compare commits

..

1536 Commits

Author SHA1 Message Date
Pilou
d6a229926b Merge pull request #1008 from nhost/changeset-release/main
chore: update versions
2022-10-18 09:50:51 +02:00
Pierre-Louis Mercereau
becde75341 Merge branch 'main' into changeset-release/main 2022-10-18 09:35:00 +02:00
Pierre-Louis Mercereau
b01ba90243 chore: correct bumps and changelog 2022-10-18 09:30:18 +02:00
Johan Eliasson
1f47c0df4a Merge pull request #1038 from nhost/example/fix-apollo-crm
Fixing React Apollo CRM
2022-10-17 20:01:39 +02:00
github-actions[bot]
dfbdd340a7 chore: update versions 2022-10-17 17:51:05 +00:00
Pilou
3448edb178 Merge pull request #1037 from nhost/fix/offline-auto-signin
fix: refresh useAuthenticationStatus on conn attempt changes
2022-10-17 19:48:53 +02:00
Johan Eliasson
1c0b9c642a removing crm example 2022-10-17 19:37:49 +02:00
Johan Eliasson
62d2eb8c99 update 2022-10-15 21:09:49 +02:00
Johan Eliasson
dc6348df04 updates 2022-10-15 21:06:31 +02:00
Johan Eliasson
ac3bdb6ef1 fix 2022-10-15 20:49:09 +02:00
Pierre-Louis Mercereau
e8c095fedc fix: refresh useAuthenticationStatus on conn attempt changes 2022-10-14 22:52:55 +02:00
Johan Eliasson
d524597557 Merge pull request #1034 from nhost/elitan-patch-3
Update serverless-functions.mdx
2022-10-14 15:07:29 +02:00
Johan Eliasson
43fb4ada76 Merge pull request #1032 from nhost/contributors-readme-action-nKo-3hYuK0
contributors readme action update
2022-10-14 15:06:04 +02:00
Johan Eliasson
e44d6af56c Update serverless-functions.mdx 2022-10-14 15:05:16 +02:00
github-actions[bot]
3a937cae48 contrib-readme-action has updated readme 2022-10-14 13:03:31 +00:00
Johan Eliasson
a60ea128be Merge pull request #1031 from chrtze/patch-3
Update serverless-functions.mdx
2022-10-14 15:03:17 +02:00
Christopher Möller
76c9a124c8 Update docs/docs/platform/serverless-functions.mdx
Co-authored-by: Johan Eliasson <johan@eliasson.me>
2022-10-14 14:32:02 +02:00
Christopher Möller
de558a0150 Update serverless-functions.mdx
I needed to do some research to find out how to see the console.log from your functions in the terminal. Maybe it's helpful to add this to the docs. Not sure if there is a more elegant way though ;) I found the necessary command here: https://youtu.be/1V6KKbRaLhM?t=645
2022-10-13 15:48:22 +02:00
Pilou
0cacd9f3d2 Merge pull request #1022 from nhost/feat/offline-startup
feat: Retry the token import when starting offline
2022-10-13 12:37:38 +02:00
Pierre-Louis Mercereau
aa7338fcdf chore: return rejected promise 2022-10-13 12:37:09 +02:00
Pierre-Louis Mercereau
6da44bf801 feat: 🎸 add connectionAttempts 2022-10-13 11:55:31 +02:00
Pierre-Louis Mercereau
44cbdf9a68 chore: merge branch 'main' into feat/offline-startup 2022-10-13 11:35:24 +02:00
Pierre-Louis Mercereau
632c1da775 chore: merge branch 'main' into feat/offline-startup 2022-10-13 11:35:05 +02:00
Pilou
bd88ea0912 Merge pull request #1029 from nhost/fix/dependencies
fix: changeset gh action and dependencies
2022-10-13 11:30:54 +02:00
Pierre-Louis Mercereau
cf38b3d82b chore: add lockfile 2022-10-13 11:04:42 +02:00
Pierre-Louis Mercereau
945adb253d fix: changeset gh action and dependencies 2022-10-13 10:56:32 +02:00
Pierre-Louis Mercereau
afb8a199eb test: start offline 2022-10-13 10:11:29 +02:00
Johan Eliasson
6c32e3a3bc Merge pull request #1028 from nhost/add-plausible
Added Plausible
2022-10-13 09:49:03 +02:00
Pierre-Louis Mercereau
bd5a6608e9 chore: merge branch 'main' into feat/offline-startup 2022-10-13 09:33:36 +02:00
Pierre-Louis Mercereau
f4eee4b885 chore: don't implement loading token attempts 2022-10-13 09:31:23 +02:00
Pilou
11a5d1ce71 Merge pull request #908 from nhost/upgrade-pnpm
Upgrade tooling and dependencies e.g. pnpm, vitest, xstate
2022-10-13 09:29:35 +02:00
Johan Eliasson
4d8055a4e7 added plausible 2022-10-13 08:52:03 +02:00
Pierre-Louis Mercereau
be10b474da chore: merge branch 'main' into feat/offline-startup 2022-10-12 18:59:36 +02:00
Pierre-Louis Mercereau
a2d77dad08 chore: 🤖 include .vscode 2022-10-12 18:52:27 +02:00
Pilou
b4acc44df6 Merge pull request #1023 from nhost/contributors-readme-action-aAAwVHnScK
contributors readme action update
2022-10-12 18:45:29 +02:00
github-actions[bot]
19f5ffc5b8 contrib-readme-action has updated readme 2022-10-12 16:32:57 +00:00
Pilou
42dde0b573 Merge pull request #1003 from nhost/fix-anonymous-sign-in
fix: 🐛 `nhost.auth.signIn()` to sign in anonymously
2022-10-12 18:32:42 +02:00
Pilou
4ecd311578 Update packages/hasura-auth-js/src/hasura-auth-client.ts
Co-authored-by: Szilárd Dóró <doroszilard@icloud.com>
2022-10-12 18:32:14 +02:00
Pierre-Louis Mercereau
1fa1f8080c ci: 🎡 fix gh actioni 2022-10-12 17:03:57 +02:00
Pierre-Louis Mercereau
d6be615fc5 chore: 🤖 keep the same node/pnpm/cache GH action order 2022-10-12 17:02:31 +02:00
Pierre-Louis Mercereau
25f0cb7144 chore: 🤖 adjust gh action 2022-10-12 16:58:50 +02:00
Pierre-Louis Mercereau
ba785da116 chore: 🤖 fix lint 2022-10-12 16:53:39 +02:00
Pierre-Louis Mercereau
4402844543 chore: adjust gh action and reactivate test 2022-10-12 16:42:36 +02:00
Pierre-Louis Mercereau
f03c458a05 chore: 🤖 add @vitest/coverage-c8 2022-10-12 16:32:31 +02:00
Pierre-Louis Mercereau
2c28cd33be chore: merge branch 'main' into upgrade-pnpm 2022-10-12 16:22:36 +02:00
Pierre-Louis Mercereau
ac65fb9dd4 chore: merge branch 'main' into upgrade-pnpm 2022-10-12 08:40:07 +02:00
Pierre-Louis Mercereau
3ced63abaa feat: Retry the token import when starting offline 2022-10-11 19:35:11 +02:00
Pilou
12fb5847fb Merge pull request #1012 from d4g0/patch-1
Recover documentation consistency
2022-10-08 20:15:31 +02:00
Pilou
ee9ab3f1ef Merge pull request #1011 from piromsurang/main
Add description for all Stripe GraphQL Fields
2022-10-08 20:14:26 +02:00
Dago
d4c2b9870c Recover documentation consistency
This file has diverged from the respective doc [page](https://docs.nhost.io/platform/quickstarts/vue#configure-nhost-with-vue)
Maybe the docs should be updated instead to match the current file, in any case, i think will be nice to fix this and avoid confusion & friction to new comers trying the vue integration out.
2022-10-08 12:05:00 -04:00
Piromsurang Rungserichai
389319582f add description to all schemas 2022-10-08 17:12:04 +07:00
Pilou
c2f9dcbbbd Merge pull request #1007 from nhost/contributors-readme-action-8LZe-sy27n
contributors readme action update
2022-10-07 20:55:32 +02:00
github-actions[bot]
69e701a742 contrib-readme-action has updated readme 2022-10-07 18:54:50 +00:00
Pilou
25db4fa5dc Merge pull request #1006 from piromsurang/main
Add description for all Stripe GraphQL Fields
2022-10-07 20:54:31 +02:00
Pilou
3c70860afa Create fuzzy-paws-raise.md 2022-10-07 19:55:43 +02:00
Piromsurang Rungserichai
0f43b942af add description on customer schema 2022-10-07 20:27:19 +07:00
Pierre-Louis Mercereau
0ea60a643f chore: 🤖 chore: don't check empty object 2022-10-07 10:43:46 +02:00
Pierre-Louis Mercereau
13c41fe667 fix: 🐛 nhost.auth.signIn() to sign in anonymously
 Closes: #1000
2022-10-07 10:41:31 +02:00
Pilou
7692abf98c Merge pull request #988 from nhost/changeset-release/main
chore: update versions
2022-10-05 16:31:01 +02:00
Pilou
4e0aafbf08 Merge pull request #994 from nhost/contributors-readme-action-Q45QQ-Yjc2
contributors readme action update
2022-10-05 16:30:10 +02:00
github-actions[bot]
5f18361d4a chore: update versions 2022-10-05 14:29:49 +00:00
github-actions[bot]
09fe573bff contrib-readme-action has updated readme 2022-10-05 14:28:51 +00:00
Pilou
b7396c3b02 Merge pull request #985 from ejkkan/feat/add-async-support-for-stripe-server-isAllowed-function
feat/added async support for isAllowed prop for createStripeGraphQLServer
2022-10-05 16:28:32 +02:00
Pilou
aa177677b5 Merge pull request #993 from nhost/update-code-owners
Update code owners
2022-10-05 12:06:38 +02:00
Pilou
c922de7b0c Create orange-geckos-pull.md 2022-10-05 10:19:51 +02:00
Pierre-Louis Mercereau
38526d7ef2 chore: update code owners 2022-10-05 10:17:32 +02:00
Erik Magnusson
057c8be55a Update packages/stripe-graphql-js/src/schema/stripe.ts
apply working async iteration of customer data

Co-authored-by: Pilou <24897252+plmercereau@users.noreply.github.com>
2022-10-05 10:06:07 +02:00
Pierre-Louis Mercereau
4783657986 chore: update code owners 2022-10-05 09:15:31 +02:00
Erik Magnusson
e3606c091f fix missig type update 2022-10-05 07:36:20 +02:00
Pilou
d5489b71ec Merge pull request #989 from nhost/chore/next-tsconfig-paths
chore: 🤖 remove empty paths in nextjs tsconfig
2022-10-03 17:01:53 +02:00
Pierre-Louis Mercereau
a6bc3091a2 chore: 🤖 remove empty paths in nextjs tsconfig 2022-10-03 16:09:33 +02:00
Pilou
01a086cd05 Merge pull request #987 from nhost/contributors-readme-action-YDPxAfJmCW
contributors readme action update
2022-10-03 13:37:35 +02:00
github-actions[bot]
a8cc2e0c9b contrib-readme-action has updated readme 2022-10-03 11:36:32 +00:00
Pilou
11f0a1493d Merge pull request #986 from altschuler/main
fix: read nextjs context cookie in clientStorage
2022-10-03 13:36:13 +02:00
Pilou
8eafa19810 Create unlucky-months-work.md 2022-10-03 13:35:07 +02:00
Simon Altschuler
1e31a9567d fix: read nextjs context cookie in clientStorage 2022-10-03 12:53:42 +02:00
Erik Magnusson
c6120bfca1 added async handling for isAllowed usages 2022-10-03 10:55:12 +02:00
Erik Magnusson
4c37cc5bc2 added async support for isAllowed prop for createStripeGraphQLServer 2022-10-03 08:47:17 +02:00
Johan Eliasson
66ef8f91a3 Merge pull request #972 from nhost/webauthn-documentation
Webauthn documentation
2022-09-29 17:43:13 +02:00
Pierre-Louis Mercereau
3f135abed9 Revert "fix: 🐛 Return a network error code"
This reverts commit 94d7703f9b.
2022-09-29 12:08:17 +02:00
Pierre-Louis Mercereau
9f127f3333 Merge branch 'webauthn-documentation' of https://github.com/nhost/nhost into webauthn-documentation 2022-09-29 12:07:11 +02:00
Pierre-Louis Mercereau
f9b164baa3 docs: ✏️ Security Keys 2022-09-29 12:07:00 +02:00
Pilou
73804c8450 Merge pull request #968 from nhost/react-apollo-example/other-sign-in-up-options
Improve navigation in the react-apollo example
2022-09-28 21:13:17 +02:00
Johan Eliasson
537259e00b Merge pull request #964 from nhost/fix-stripe-asd91h23
Stripe GraphQL API updates
2022-09-28 17:28:34 +02:00
Pierre-Louis Mercereau
94d7703f9b fix: 🐛 Return a network error code 2022-09-28 17:13:45 +02:00
Pierre-Louis Mercereau
c24207eeea feat: improve navigation 2022-09-28 17:06:13 +02:00
Johan Eliasson
54057ffe8a typo 2022-09-28 16:33:41 +02:00
Johan Eliasson
0e9052e810 added info about stripe secret key 2022-09-28 16:24:38 +02:00
Pilou
3a209a8ee3 Merge pull request #967 from nhost/bump-hasura-auth-0.13.2
chore: 🤖 bump hasura-auth version to 0.13.2
2022-09-28 15:44:25 +02:00
Pierre-Louis Mercereau
f26d38a0f1 chore: 🤖 bump hasura-auth version to 0.13.2 2022-09-28 15:08:38 +02:00
Johan Eliasson
0e06259e24 update 2022-09-27 15:10:30 +02:00
Johan Eliasson
ce7d81c6d3 correct package names 2022-09-27 15:02:44 +02:00
Johan Eliasson
3779772c99 Merge pull request #963 from nhost/docs-database
doc (database): UI updates and direct access
2022-09-27 15:01:28 +02:00
Johan Eliasson
c657cb85cf identity explination 2022-09-27 12:11:45 +02:00
Johan Eliasson
46dfa9634c wording 2022-09-27 12:07:47 +02:00
Johan Eliasson
13f5531b7e update 2022-09-27 12:03:53 +02:00
Johan Eliasson
0ecff620fb Update docs/docs/platform/database/index.mdx
Co-authored-by: Szilárd Dóró <doroszilard@icloud.com>
2022-09-27 11:56:23 +02:00
Johan Eliasson
0470e65a38 Update docs/docs/platform/database/index.mdx
Co-authored-by: Szilárd Dóró <doroszilard@icloud.com>
2022-09-27 11:56:01 +02:00
Johan Eliasson
f031cf9463 update 2022-09-27 10:39:01 +02:00
Pilou
9f81ba9713 Merge pull request #956 from nhost/changeset-release/main
chore: update versions
2022-09-26 16:26:49 +02:00
Pierre-Louis Mercereau
2f815e5eb6 chore: correct version bump 2022-09-26 16:12:08 +02:00
Pierre-Louis Mercereau
2cabd2d29a Merge branch 'changeset-release/main' of https://github.com/nhost/nhost into changeset-release/main 2022-09-26 16:08:40 +02:00
github-actions[bot]
d4ee6cc756 chore: update versions 2022-09-26 14:00:32 +00:00
Szilárd Dóró
8208b1c385 Merge pull request #958 from nhost/fix/nextjs-ssg
fix (react-apollo): broken Next.js SSG
2022-09-26 15:59:15 +02:00
Johan Eliasson
4c6c094f71 Merge pull request #957 from nhost/fix/stripe-graphql-updates
stripe graphiql option + readme updates
2022-09-26 15:57:57 +02:00
Johan Eliasson
3dadc7eab9 Merge pull request #954 from nhost/fix/import-users
docs: import users
2022-09-26 15:56:05 +02:00
Johan Eliasson
784041020b Create spotty-wasps-remember.md 2022-09-26 15:55:49 +02:00
Szilárd Dóró
74758f2c36 fix (react-apollo): broken Next.js SSG
Fixes #873
2022-09-26 15:44:02 +02:00
Johan Eliasson
ea34a3856b update 2022-09-26 13:59:08 +02:00
Johan Eliasson
c9175b76d3 readme update 2022-09-26 13:57:57 +02:00
Pierre-Louis Mercereau
1c82522163 chore: undo major peer bumps 2022-09-26 13:45:47 +02:00
github-actions[bot]
5794357374 chore: update versions 2022-09-26 11:40:59 +00:00
Pilou
3edf41f989 Merge pull request #942 from nhost/webauthn-signup
WebAuthn: signup
2022-09-26 13:39:41 +02:00
Johan Eliasson
44f069a253 graphiql 2022-09-26 13:37:21 +02:00
Johan Eliasson
cb0988cb87 readme about impor users 2022-09-26 09:05:06 +02:00
Pierre-Louis Mercereau
27752ca8a7 chore: lint 2022-09-23 13:00:42 +02:00
Pierre-Louis Mercereau
855181abbc refactor: complete name consistency 2022-09-23 12:57:46 +02:00
Pierre-Louis Mercereau
bc0515bd59 Merge branch 'webauthn-signup' of https://github.com/nhost/nhost into webauthn-signup 2022-09-23 12:47:55 +02:00
Pierre-Louis Mercereau
271c401b1a refactor: 💡 consistent names, and adjust example nav 2022-09-23 12:47:34 +02:00
Pilou
cbed7cdc72 Update .changeset/old-games-talk.md
Co-authored-by: Johan Eliasson <johan@nhost.io>
2022-09-23 12:31:39 +02:00
Pilou
fca620f050 Update .changeset/grumpy-ghosts-kneel.md
Co-authored-by: Johan Eliasson <johan@nhost.io>
2022-09-23 12:31:33 +02:00
Pilou
5200a4f272 Update .changeset/angry-dragons-carry.md
Co-authored-by: Johan Eliasson <johan@nhost.io>
2022-09-23 12:31:16 +02:00
Pierre-Louis Mercereau
19458cf076 refactor: bump hasura-auth to v0.13.0 2022-09-23 11:25:48 +02:00
Pierre-Louis Mercereau
1a94359a81 fix: add security key nickname to sign up options 2022-09-22 11:57:26 +02:00
Pierre-Louis Mercereau
96001f683a docs: adapt react-apollo example to the blog post 2022-09-22 09:57:39 +02:00
Pierre-Louis Mercereau
dd08453fb5 chore: adjust from review 2022-09-21 19:27:22 +02:00
Pierre-Louis Mercereau
739a3c4563 chore: 🤖 update changesets 2022-09-21 15:07:00 +02:00
Pierre-Louis Mercereau
20f3eb9086 refactor: 💡 remove irrelevant test 2022-09-21 14:54:36 +02:00
Pierre-Louis Mercereau
7b5f8647fb test: 💍 security key sign up 2022-09-21 14:49:03 +02:00
Pilou
486ddec751 Merge pull request #945 from nhost/guicurcio-patch-3
Update README.md
2022-09-21 13:50:27 +02:00
Guido Curcio
6475047158 Update README.md 2022-09-21 04:47:03 -07:00
Pierre-Louis Mercereau
14b26bdbc7 Merge branch 'main' into webauthn-signup 2022-09-21 12:37:48 +02:00
Pierre-Louis Mercereau
8e4d790b04 feat: 🎸 sign up with an email and a security key 2022-09-21 12:34:01 +02:00
Johan Eliasson
d814c7b46b Merge pull request #944 from nhost/fix/graphql-stripe-js
Fix/graphql stripe js
2022-09-20 20:17:54 +02:00
Johan Eliasson
5baeddba0b removed tmp changeset 2022-09-20 20:14:34 +02:00
Johan Eliasson
0262723329 Merge branch 'main' into fix/graphql-stripe-js 2022-09-20 20:14:17 +02:00
Johan Eliasson
1cf8a58d2c updated version 2022-09-20 20:12:13 +02:00
Johan Eliasson
b9a19d8251 Merge pull request #943 from nhost/fix/graphql-stripe-js
changeset update
2022-09-20 19:40:45 +02:00
Johan Eliasson
465d248456 changeset update 2022-09-20 19:19:00 +02:00
Pierre-Louis Mercereau
9e4861f2bb refactor: sign-in screens 2022-09-20 16:46:49 +02:00
Johan Eliasson
4ca738ba56 Merge pull request #916 from nhost/feat/graphql-stripe
feat: Stripe GraphQL
2022-09-20 12:49:53 +02:00
Johan Eliasson
be27ed73e1 new lock file 2022-09-20 12:21:15 +02:00
Johan Eliasson
f4d81d33b9 Merge branch 'main' into feat/graphql-stripe 2022-09-20 12:17:54 +02:00
Johan Eliasson
730c7d7b28 update 2022-09-20 12:16:25 +02:00
github-actions[bot]
38de442a7f chore: update versions 2022-09-20 12:15:55 +02:00
Johan Eliasson
22b8f02504 Update packages/stripe-graphql-js/README.md
Co-authored-by: Pilou <24897252+plmercereau@users.noreply.github.com>
2022-09-20 12:13:59 +02:00
Pilou
79f268ea08 Merge pull request #931 from nhost/changeset-release/main
chore: update versions
2022-09-20 11:58:56 +02:00
Pierre-Louis Mercereau
24825adb08 feat: improve navigation and names 2022-09-20 11:48:59 +02:00
Johan Eliasson
96e59f0251 update 2022-09-20 11:18:53 +02:00
Johan Eliasson
9e43c320b9 remove unused variable 2022-09-20 11:04:03 +02:00
Johan Eliasson
f199ed5474 update 2022-09-20 11:03:33 +02:00
Johan Eliasson
2f00d7f309 updates 2022-09-20 10:44:54 +02:00
Johan Eliasson
d35dfb1aa0 readme update 2022-09-20 08:35:17 +02:00
Johan Eliasson
93f1d1944c rename 2022-09-19 17:05:05 +02:00
Johan Eliasson
efd3904966 update 2022-09-19 16:53:54 +02:00
Johan Eliasson
133e682e91 claims update 2022-09-19 15:57:34 +02:00
Johan Eliasson
72eebe538e reworked permissions a bit 2022-09-19 14:17:11 +02:00
Johan Eliasson
af313212f7 added metadata 2022-09-19 10:45:11 +02:00
Johan Eliasson
06b29f14fc minor updates 2022-09-19 09:40:16 +02:00
Johan Eliasson
4b960227cf README notice message 2022-09-19 09:37:14 +02:00
Johan Eliasson
a9e2db678d update 2022-09-16 16:33:57 +02:00
Johan Eliasson
4d0738d51c Create tiny-monkeys-jog.md 2022-09-16 15:47:16 +02:00
Johan Eliasson
1a8160632e merge 2022-09-16 15:44:51 +02:00
Johan Eliasson
084ea77355 Merge branch 'main' into feat/graphql-stripe 2022-09-16 15:43:17 +02:00
Johan Eliasson
19e5abb4a9 customers 2022-09-16 11:37:04 +02:00
Johan Eliasson
fe6514fa14 update 2022-09-16 11:14:08 +02:00
Johan Eliasson
92e9659cc7 invoice updates 2022-09-16 11:12:56 +02:00
Johan Eliasson
d5a2a259ce more invoice implementations 2022-09-15 15:19:41 +02:00
Johan Eliasson
6929c7f423 invoice updates 2022-09-14 18:38:34 +02:00
Pilou
d5f56f7e18 Merge pull request #934 from nhost/contributors-readme-action-nCzaq6ybCG
contributors readme action update
2022-09-13 11:04:57 +02:00
github-actions[bot]
6ddaf47a4b chore: update versions 2022-09-13 09:04:53 +00:00
github-actions[bot]
11200934a8 contrib-readme-action has updated readme 2022-09-13 09:03:26 +00:00
Pilou
653f6b5766 Merge pull request #910 from nhost/webauthn
Authentication with security keys and the WebAuthn API
2022-09-13 11:03:09 +02:00
Pilou
653c886ec0 Merge pull request #932 from eltociear/patch-1
Fix typo in init.mdx
2022-09-12 19:19:29 +02:00
Ikko Ashimine
ecba8f78ac Fix typo in init.mdx
Intialize -> Initialize
2022-09-13 02:17:44 +09:00
Pierre-Louis Mercereau
d7b5261f5a Merge branch 'main' into webauthn 2022-09-12 18:43:40 +02:00
Pierre-Louis Mercereau
164e8cac28 doc: inline 2022-09-12 18:35:54 +02:00
Pierre-Louis Mercereau
ad0d56416c refactor: don't list or remove security keys 2022-09-12 17:00:12 +02:00
Pilou
c47ba63dd9 Merge pull request #922 from nhost/workos
Add workos provider
2022-09-12 16:15:10 +02:00
Pilou
47fb75302f Merge pull request #924 from nhost/bump-hasura-auth-0.11
Bump hasura-auth to version 0.11
2022-09-09 21:24:47 +02:00
Pierre-Louis Mercereau
2c95ed2d14 refactor: another change in types 2022-09-09 11:21:53 +02:00
Pierre-Louis Mercereau
07eb26ca29 refactor: improve typings 2022-09-09 11:16:46 +02:00
Pierre-Louis Mercereau
90843a9feb refactor: early returns 2022-09-09 09:31:06 +02:00
Johan Eliasson
5e5a9d6efa updates 2022-09-08 16:16:29 +02:00
Pierre-Louis Mercereau
5fc3b643a7 Merge branch 'bump-hasura-auth-0.11' into webauthn 2022-09-08 12:42:23 +02:00
Johan Eliasson
a365cadbd7 stripe internally + dotenv fix 2022-09-08 12:29:51 +02:00
Pierre-Louis Mercereau
eb93a20bc0 chore: 🤖 bump hasura-auth version to 0.11 2022-09-08 12:23:00 +02:00
Pierre-Louis Mercereau
ac2cd3f34e revert: docgen 2022-09-07 13:15:25 +02:00
Pierre-Louis Mercereau
26cb0de087 test: webauthn 2022-09-07 12:48:13 +02:00
Pierre-Louis Mercereau
6d93aa4235 docs: add core to typedoc's hasura-auth-js 2022-09-07 11:40:43 +02:00
Johan Eliasson
8221664f61 payment methods completed 2022-09-07 10:48:27 +02:00
Johan Eliasson
9396bdbbe3 working 2022-09-07 09:35:33 +02:00
Johan Eliasson
63fd6abd54 enum updates 2022-09-07 09:21:54 +02:00
Pierre-Louis Mercereau
03d7083d3e feat: workos options types 2022-09-06 22:11:46 +02:00
Pierre-Louis Mercereau
618e5a8db2 chore: merge main 2022-09-06 22:00:03 +02:00
Pierre-Louis Mercereau
3a217fd490 style: use #graphql 2022-09-06 21:58:32 +02:00
Johan Eliasson
4e30b4ee21 allowed updated 2022-09-06 21:14:21 +02:00
Pierre-Louis Mercereau
99bbdc37f9 Merge branch 'main' into upgrade-pnpm 2022-09-06 11:26:32 +02:00
Pierre-Louis Mercereau
9eb78e06db feat: add workos provider 2022-09-06 11:05:56 +02:00
Pierre-Louis Mercereau
3d7369a19e refactor: break blocks with return statements 2022-09-06 10:33:00 +02:00
Pierre-Louis Mercereau
8e03774bc1 refactor: types 2022-09-06 10:27:12 +02:00
Pilou
13937fa026 Update packages/react/src/useSecurityKeys.ts
Co-authored-by: Szilárd Dóró <doroszilard@icloud.com>
2022-09-06 10:24:14 +02:00
Pilou
9e57a2bfe6 Update packages/react/src/useSecurityKeys.ts
Co-authored-by: Szilárd Dóró <doroszilard@icloud.com>
2022-09-06 10:24:04 +02:00
Johan Eliasson
b07a61b8e4 updates 2022-09-06 10:00:06 +02:00
Johan Eliasson
f52336f698 restructure and started adding payment methods and subscriptions 2022-09-06 09:33:03 +02:00
Pierre-Louis Mercereau
bf4cc38f8d refactor: remove rp_id 2022-09-05 21:31:34 +02:00
Pierre-Louis Mercereau
4e7d1fbe90 docs: inline documentation 2022-09-05 21:12:12 +02:00
Pierre-Louis Mercereau
ac214019dc docs: move TODO into an issue 2022-09-05 16:52:22 +02:00
Pilou
5ff6876aea Merge pull request #918 from nhost/changeset-release/main
chore: update versions
2022-09-05 10:54:49 +02:00
github-actions[bot]
d392ed86fb chore: update versions 2022-09-05 08:27:06 +00:00
Johan Eliasson
2d6e95b8b5 cleanup 2022-09-05 10:25:34 +02:00
Pilou
3bbe09c4b1 Merge pull request #917 from nhost/fix-passwordless-email-options
fix: add options to `nhost.auth.signIn({ email, options })`
2022-09-05 10:25:30 +02:00
Johan Eliasson
648c880445 update readme 2022-09-05 10:23:26 +02:00
Johan Eliasson
c286a0bbb1 adding payment method 2022-09-05 10:16:12 +02:00
Johan Eliasson
745d9a958d using pothos instead 2022-09-05 10:13:08 +02:00
Pierre-Louis Mercereau
a47ce29173 fix: add options to nhost.auth.signIn({ email, options }) 2022-09-05 09:57:46 +02:00
Johan Eliasson
8c12b4117b updates 2022-09-05 07:57:04 +02:00
Pierre-Louis Mercereau
2f432b5c5f feat: useSecurityKeys 2022-09-03 22:25:32 +02:00
Johan Eliasson
afcced2417 readme update 2022-09-03 15:44:03 +02:00
Johan Eliasson
88fa68e74c update readme 2022-09-03 15:37:08 +02:00
Johan Eliasson
47b4a3ecf1 updates 2022-09-03 15:35:06 +02:00
Johan Eliasson
9095a0f6ae init 2022-09-03 15:21:47 +02:00
Pierre-Louis Mercereau
4629b952c6 refactor: change to "security key" terminology 2022-09-02 20:36:46 +02:00
Pierre-Louis Mercereau
f6cfca9288 refactor: change to "security key" terminology 2022-09-02 19:49:16 +02:00
Pierre-Louis Mercereau
06523f2619 ci: new pnpm filter 2022-09-02 17:17:59 +02:00
Pierre-Louis Mercereau
f9f05b4cd7 ci: reactivate e2e tests 2022-09-02 17:14:36 +02:00
Pierre-Louis Mercereau
242a2a97ef ci: install in workspace root 2022-09-02 17:10:52 +02:00
Pierre-Louis Mercereau
62a8a968ec ci: typo 2022-09-02 17:08:38 +02:00
Pierre-Louis Mercereau
8d3c83015c ci: install cypress 2022-09-02 17:05:44 +02:00
Pierre-Louis Mercereau
f783a2d956 ci: cache cypress 2022-09-02 17:04:27 +02:00
Pierre-Louis Mercereau
a8ea4e273e ci: add cypress container 2022-09-02 16:53:45 +02:00
Pierre-Louis Mercereau
4238a6985c ci: adapt cypress 2022-09-02 16:50:13 +02:00
Pierre-Louis Mercereau
494b230868 ci: use cypress gh action 2022-09-02 16:46:12 +02:00
Pierre-Louis Mercereau
7eb7a337ac ci: put the build step in the main install action 2022-09-02 16:36:55 +02:00
Pierre-Louis Mercereau
472dcf2b9c chore: add build step 2022-09-02 16:30:14 +02:00
Pierre-Louis Mercereau
ac02b38bed chore: bump pnpm gh action 2022-09-02 16:20:09 +02:00
Pierre-Louis Mercereau
37e06e1cf7 style: please eslint rules 2022-09-02 15:39:46 +02:00
Pierre-Louis Mercereau
bb2b1f5078 chore: fix dependencies 2022-09-02 15:26:55 +02:00
Pierre-Louis Mercereau
1205a89029 chore: lockfile 2022-09-02 15:21:45 +02:00
Pierre-Louis Mercereau
d498d5d029 chore: downgrade pnpm to please vercel 2022-09-02 15:19:32 +02:00
Pierre-Louis Mercereau
182dfb0b22 chore: bump dependencies 2022-09-02 14:51:00 +02:00
Pierre-Louis Mercereau
b9c012e263 test: adapt navigation 2022-09-02 11:51:13 +02:00
Pierre-Louis Mercereau
0e112674a4 refactor: explicitly bundle simple webtauthn 2022-09-02 10:57:51 +02:00
Pierre-Louis Mercereau
0feac15d10 fix: bundle @simplewebauth into @nhost/core 2022-09-02 10:32:56 +02:00
Pierre-Louis Mercereau
f42b693aa2 feat: add webauthn to nhost.auth.signIn 2022-09-01 14:33:35 +02:00
Pierre-Louis Mercereau
9687581dc7 feat: add device nickname and adapt example 2022-09-01 14:24:24 +02:00
Pierre-Louis Mercereau
9bf938a507 refactor: rename to passwordlessWebauthn 2022-09-01 10:04:45 +02:00
Pierre-Louis Mercereau
06bc8856dd refactor: simplify 2022-08-30 22:41:21 +02:00
Pierre-Louis Mercereau
1c3c7c225f feat: wip webauthn 2022-08-30 22:21:35 +02:00
Pilou
42fba7a095 Merge pull request #907 from nhost/core-typings
fix: improve typings
2022-08-30 11:24:13 +02:00
Pierre-Louis Mercereau
3fd9e4601d Merge branch 'main' into upgrade-pnpm 2022-08-30 11:10:12 +02:00
Pierre-Louis Mercereau
0ff633760a Merge branch 'main' into core-typings 2022-08-30 11:09:05 +02:00
Pilou
6c51571182 Merge pull request #909 from nhost/bump-storage-version-0.2.4
ci: bump hasura-storage version to 0.2.4
2022-08-30 11:08:44 +02:00
Pierre-Louis Mercereau
3825a09aed ci: bump hasura-storage version to 0.2.4 2022-08-30 10:25:57 +02:00
Pierre-Louis Mercereau
1768b1e069 docs: comment types & interfaces 2022-08-30 09:23:53 +02:00
Pierre-Louis Mercereau
cd7d6ddf11 ci: correct pnpm command 2022-08-29 22:27:11 +02:00
Pierre-Louis Mercereau
301d9f1710 refactor: new pnpm 7 -- syntax 2022-08-29 22:18:25 +02:00
Pierre-Louis Mercereau
46d54b9f77 revert: go back to previous pnpm invokation 2022-08-29 22:13:01 +02:00
Pierre-Louis Mercereau
31671aa7b9 build: upgrade pnpm to v7.9.5 2022-08-29 21:55:18 +02:00
Pierre-Louis Mercereau
fba5c819ce fix: improve typings 2022-08-29 21:39:26 +02:00
Johan Eliasson
9dea25ebe1 Merge pull request #900 from nhost/changeset-release/main
chore: update versions
2022-08-25 10:58:02 +02:00
github-actions[bot]
9b063abe32 chore: update versions 2022-08-25 07:53:20 +00:00
Johan Eliasson
cea97ba333 Merge pull request #898 from nhost/changeset-iasgd9ad
adding changeset for storage upload
2022-08-25 09:52:09 +02:00
Johan Eliasson
607c457f9d adding changeset for storage upload 2022-08-25 09:14:56 +02:00
Johan Eliasson
6ea9ed69ce Merge pull request #893 from nhost/fix/storage-in-node
Make @nhost/storage-js work on non-browser environments
2022-08-25 09:03:16 +02:00
Johan Eliasson
6450dcc02e overloading 2022-08-25 08:20:31 +02:00
Johan Eliasson
0b18704d5b updates 2022-08-24 18:04:07 +02:00
Johan Eliasson
0c53f9034e adding empty functions folder for nhost-js 2022-08-24 15:07:52 +02:00
Johan Eliasson
0c90292779 adding correct health check endpoints and new vite config files where needed 2022-08-24 15:05:24 +02:00
Johan Eliasson
2333aeb0c8 no tests 2022-08-24 14:58:13 +02:00
Johan Eliasson
3b686a231b use GET request 2022-08-24 14:47:01 +02:00
Johan Eliasson
136b85c5fb add empty package.json in the functions folder 2022-08-24 13:53:30 +02:00
Johan Eliasson
3d715d5f95 wait for hasura console to be up' 2022-08-24 10:38:34 +02:00
Johan Eliasson
6d5295aeca exclude is not needed as we're using include 2022-08-24 10:29:26 +02:00
Johan Eliasson
45f6285249 vite config for storage-js 2022-08-24 10:21:02 +02:00
Pierre-Louis Mercereau
01fb999c7d ci: remove chown 2022-08-24 10:14:52 +02:00
Johan Eliasson
8b8412d5fa exclude paths for vitest 2022-08-24 10:11:51 +02:00
Pierre-Louis Mercereau
0f1311c5b0 ci: correct gh expression 2022-08-24 10:09:34 +02:00
Pierre-Louis Mercereau
6b197aa886 ci: chown package folder 2022-08-24 10:05:14 +02:00
Pierre-Louis Mercereau
0353c6648e ci: change permissions 2022-08-24 09:58:55 +02:00
Johan Eliasson
978b8f8f68 install cli as sudo 2022-08-24 09:37:06 +02:00
Johan Eliasson
3643449a9a update 2022-08-24 07:59:04 +02:00
Johan Eliasson
8e25971e7d move nhost folder 2022-08-24 07:44:24 +02:00
Johan Eliasson
5cf05c8731 correct config 2022-08-23 13:51:48 +02:00
Johan Eliasson
4da70abcfb cleanup 2022-08-23 13:50:31 +02:00
Johan Eliasson
2d5203872c delete test functions folder 2022-08-23 13:49:31 +02:00
Johan Eliasson
882f1531ab update types and docs 2022-08-23 13:47:48 +02:00
Johan Eliasson
6126d77b01 updated tests 2022-08-23 13:47:48 +02:00
Johan Eliasson
09debbd746 Merge branch 'main' into fix/storage-in-node 2022-08-23 12:12:51 +02:00
Johan Eliasson
604ed6b314 readme update 2022-08-23 12:12:11 +02:00
Johan Eliasson
2f1fec1dcf new tests 2022-08-23 12:07:19 +02:00
Johan Eliasson
293bdc3f1c Merge pull request #892 from nhost/changeset-release/main
chore: update versions
2022-08-23 08:55:17 +02:00
Johan Eliasson
70f537841f make storage work on server 2022-08-23 08:01:28 +02:00
github-actions[bot]
b670dc396b chore: update versions 2022-08-22 20:19:44 +00:00
Pilou
88800ba4b4 Merge pull request #786 from nhost/feature/fallback-to-1337
Use :1337 if no port is specified when using "localhost"
2022-08-22 22:18:01 +02:00
Johan Eliasson
d412669c86 removed pnpm lock files in examples 2022-08-22 22:01:03 +02:00
Johan Eliasson
8600acb6f2 Merge branch 'main' into feature/fallback-to-1337 2022-08-22 21:57:31 +02:00
Johan Eliasson
0e2e2344f2 Merge pull request #891 from nhost/fix-cli-update
CLI update fixes
2022-08-22 21:55:51 +02:00
Johan Eliasson
8a91673242 removed pnpm lock files in examples 2022-08-22 21:41:42 +02:00
Pierre-Louis Mercereau
63f27235be refactor: adapt sync-versions to the new cli 2022-08-22 21:34:53 +02:00
Johan Eliasson
7feadbe55d nhost cli updates 2022-08-22 21:25:19 +02:00
Johan Eliasson
98e5680f48 nhost-js package updated 2022-08-22 20:46:07 +02:00
Johan Eliasson
8d6ebf9032 updated config 2022-08-22 20:35:52 +02:00
Johan Eliasson
9feea987e6 remove tmp cypress folders 2022-08-22 20:25:16 +02:00
Johan Eliasson
c2d77bbb7c updated example with latest CLI 2022-08-22 20:18:46 +02:00
Johan Eliasson
4468654054 new config for new cli 2022-08-22 19:55:41 +02:00
Johan Eliasson
998291ea9d correct subdomain 2022-08-22 19:35:07 +02:00
Johan Eliasson
eb46f7d8b7 Create great-adults-compare.md 2022-08-22 19:33:32 +02:00
Johan Eliasson
7bc11a1985 subdomain don't need 1337 2022-08-22 19:31:58 +02:00
Johan Eliasson
0fadc0d3da code + nhost cli updates 2022-08-22 19:26:38 +02:00
Johan Eliasson
814856da0d Merge branch 'main' into feature/fallback-to-1337 2022-08-22 18:43:08 +02:00
Johan Eliasson
1bf5114d6b updates 2022-08-22 18:42:28 +02:00
Johan Eliasson
ed618e0c41 Merge pull request #887 from nhost/remove-templates
Remove templates
2022-08-22 18:14:11 +02:00
Pilou
8a272b5b72 Merge pull request #883 from nhost/docker-email-templates
docs: add email templates to docker-compose, and remove obsolete example
2022-08-22 16:53:43 +02:00
Johan Eliasson
2a0107db55 removed mentions of templates/ 2022-08-22 16:46:36 +02:00
Johan Eliasson
48a90c4f69 remove templates 2022-08-19 13:02:03 +02:00
Pilou
686d3f1b09 Merge pull request #884 from nhost/bump-hasura-2.10.1
Bump hasura version to 2.10.1
2022-08-17 17:59:24 +02:00
Pierre-Louis Mercereau
6b4b4a5798 chore: bump hasura version to 2.10.1 2022-08-17 08:27:59 +02:00
Pierre-Louis Mercereau
3a14b90557 docs: add email templates to docker-compose, and remove obsolete example
the `custom-email-templates` is obsolete as it is now possible to deploy templates with the Nhost GH
integration
2022-08-16 11:02:26 +02:00
Szilárd Dóró
9871bd42e0 Merge pull request #863 from nhost/changeset-release/main
chore: update versions
2022-08-10 10:26:48 +02:00
github-actions[bot]
7982702e26 chore: update versions 2022-08-09 06:53:50 +00:00
Johan Eliasson
7e21fe5c2b Merge pull request #871 from nhost/use-project-wording
Terminology: app -> project
2022-08-09 08:52:17 +02:00
Johan Eliasson
cc4d2ee81a Merge pull request #872 from nhost/storage-fixes-123iygasd
Storage typos
2022-08-05 18:06:37 +02:00
Johan Eliasson
a96adbcd9d sotrage typos 2022-08-05 16:23:35 +02:00
Johan Eliasson
f1ad4a37db u 2022-08-05 11:23:53 +02:00
Johan Eliasson
83b4f7c0eb project overview 2022-08-05 11:18:07 +02:00
Johan Eliasson
45fd0669ee updates 2022-08-05 11:14:33 +02:00
Johan Eliasson
d20add9329 update 2022-08-05 10:08:29 +02:00
Johan Eliasson
58854835e0 upadtes 2022-08-05 10:07:04 +02:00
Johan Eliasson
88a6f3f500 typo 2022-08-05 10:03:49 +02:00
Johan Eliasson
8336e53931 package updates 2022-08-05 10:01:03 +02:00
Johan Eliasson
674fd66922 more updates 2022-08-05 09:55:10 +02:00
Johan Eliasson
fc94bfdd66 app -> project 2022-08-05 08:33:53 +02:00
Johan Eliasson
f299578d69 Merge pull request #868 from nhost/contributors-readme-action-DOCBwXss13
contributors readme action update
2022-08-02 20:42:55 +02:00
github-actions[bot]
221032f087 contrib-readme-action has updated readme 2022-08-02 18:42:13 +00:00
Johan Eliasson
72799762c9 Merge pull request #842 from nhost/example/react-query
GraphQL Code Generator with React Query
2022-08-02 20:41:54 +02:00
Johan Eliasson
6464584d71 updated to react query v4 2022-08-02 20:23:20 +02:00
Johan Eliasson
7ca196955a Merge branch 'main' into example/react-query 2022-08-02 20:08:09 +02:00
Johan Eliasson
90b84ea8c4 Update examples/codegen-react-query/README.md
Co-authored-by: Guido Curcio <guidomaurocurcio@gmail.com>
2022-07-31 09:53:51 +02:00
Johan Eliasson
7ca3c42d23 Apply suggestions from code review
Co-authored-by: Guido Curcio <guidomaurocurcio@gmail.com>
2022-07-31 09:53:42 +02:00
Nuno Pato
bb10741334 Merge pull request #860 from nhost/fix/update-wrong-docs
fix docs
2022-07-28 17:48:26 +00:00
Nuno Pato
50293e7dd8 fix messaging around the folder structure created by nhost init 2022-07-28 17:39:06 +00:00
Nuno Pato
bebe65c4c5 remove -n from --remote 2022-07-28 17:33:15 +00:00
Szilárd Dóró
e2f5cfe9c0 Merge pull request #861 from nhost/contributors-readme-action-NCWsLhOUvy
contributors readme action update
2022-07-28 16:09:52 +02:00
github-actions[bot]
cac64f70c4 contrib-readme-action has updated readme 2022-07-28 14:09:18 +00:00
Szilárd Dóró
302e0aa1e0 Merge pull request #850 from mdp18/docs/js-passwordless-clarify
Update for reference docs 02-sign-in.mdx
2022-07-28 16:08:59 +02:00
Szilárd Dóró
e6a44dc008 chore: auto-generated documentation updates 2022-07-28 14:48:29 +02:00
Szilárd Dóró
93cc6920b6 added changesets 2022-07-28 14:47:15 +02:00
Nuno Pato
4c6e9c7839 fix docs 2022-07-28 11:44:41 +00:00
Max
f4a1eef3d4 fix 2
reversed mdx file and added fix to hasura-auth-client
2022-07-25 13:24:24 -07:00
Szilárd Dóró
2766875ff7 Merge pull request #852 from LucasBois1/patch-1
Typo fix storage.mdx
2022-07-25 15:21:19 +02:00
Lucas Bois
ea61275404 Typo fix storage.mdx 2022-07-23 10:47:01 -03:00
Max
1191cb4fd8 Update 02-sign-in.mdx 2022-07-22 15:10:29 -07:00
Pilou
f6e1517a7a Merge pull request #843 from nhost/contributors-readme-action-O05tbtr6_i
contributors readme action update
2022-07-19 11:11:07 +02:00
github-actions[bot]
e15cb8b798 contrib-readme-action has updated readme 2022-07-19 08:43:33 +00:00
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
Nuno Pato
5485d48ce5 Use :1337 if no port is specified when using "localhost" 2022-07-04 00:14:46 +00: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
Szilárd Dóró
20005986a9 Merge pull request #765 from nhost/changeset-release/main
chore: update versions
2022-06-28 16:15:23 +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
c1d722390f revert: correct peer deps version bumps 2022-06-28 13:33:44 +02:00
Pierre-Louis Mercereau
165ff16cdc Merge branch 'main' into docs/example-on-vercel 2022-06-28 13:25:50 +02:00
github-actions[bot]
111d6d99a1 chore: update versions 2022-06-28 11:19:14 +00:00
Pilou
dabbb6ec0d Merge pull request #624 from nhost/feat/file-upload
file upload hooks
2022-06-28 13:17:43 +02:00
Pierre-Louis Mercereau
7174aa1384 fix: do not clear errord list when already empty 2022-06-28 13:07:38 +02:00
Pierre-Louis Mercereau
e3ef4a0188 revert: keep localhost:1337 as default url 2022-06-28 12:21:18 +02:00
Pierre-Louis Mercereau
82ac9b9684 chore: xstate does not support async callbacks 2022-06-28 12:05:51 +02:00
Pierre-Louis Mercereau
bd494434d9 chore: review adjustments 2022-06-28 11:30:10 +02:00
Pierre-Louis Mercereau
0ee47821cd chore: remove console.log 2022-06-28 11:14:01 +02:00
Pierre-Louis Mercereau
0dc01a99e9 add redirectTo to oauth links 2022-06-28 11:11:07 +02:00
Pierre-Louis Mercereau
3a04c272ee chore: use async/await syntax 2022-06-28 11:09: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
Pierre-Louis Mercereau
dd38973515 chore: review adjustments 2022-06-28 10:25:08 +02:00
Johan Eliasson
9ab5b7a927 Merge pull request #764 from nhost/chore/deploy
chore: trigger again
2022-06-28 09:17:18 +02:00
Pierre-Louis Mercereau
406132902d chore: trigger again 2022-06-28 09:14:42 +02:00
Johan Eliasson
7503b0d840 Merge pull request #763 from nhost/chore/deploy
chore: trigger deployment
2022-06-28 09:12:07 +02:00
Pierre-Louis Mercereau
d42cb698c1 chore: trigger deployment 2022-06-28 09:05:09 +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
c944ef11e4 docs: fix docgen broken link 2022-06-27 23:53:49 +02:00
Pierre-Louis Mercereau
d9e2e41efd feat: multiple upload errors and promises 2022-06-27 23:40:31 +02:00
Pilou
1219356c8f Merge pull request #757 from nhost/docs/docker-compose-functions
docs: add functions to docker-compose example
2022-06-27 19:52:28 +02:00
Pilou
2eb7467afa Merge pull request #759 from nhost/chore/trigger-deployment
chore: trigger a new deployment
2022-06-27 16:34:14 +02:00
Pierre-Louis Mercereau
12f42319f9 chore: trigger a new deployment 2022-06-27 16:32:26 +02:00
Pilou
bbc9c6131b Merge pull request #758 from nhost/changeset-release/main
chore: update versions
2022-06-27 11:59:51 +02:00
github-actions[bot]
c16be7fb05 chore: update versions 2022-06-27 09:51:39 +00:00
Szilárd Dóró
872e44ebe0 Merge pull request #756 from nhost/fix/bundling-improvements
fix: `exports` field to support server-side environments
2022-06-27 11:50:21 +02:00
Pierre-Louis Mercereau
a898a19ffa docs: add functions to docker-compose example 2022-06-27 10:46:13 +02:00
Szilárd Dóró
dbc10e6205 fix: fixed exports field in all packages
- added changeset
2022-06-27 10:35:17 +02:00
Pilou
b04d01f022 Merge pull request #755 from nhost/docs/readme
docs: update twitter handle & hasura-storage link
2022-06-27 09:30:20 +02:00
Pilou
29d0c7250f Merge pull request #754 from nhost/docs/fix-provider-links
React-apollo example: correct links to external urls (social providers)
2022-06-27 09:30:02 +02:00
Pierre-Louis Mercereau
b59f571048 docs: update twitter handle & hasura-storage link 2022-06-26 22:34:56 +02:00
Pierre-Louis Mercereau
64cc648d19 docs(example): correct react-apollo external links 2022-06-26 21:10:39 +02:00
Pierre-Louis Mercereau
5f05d46c3d fix: use xstate/react syntax 2022-06-25 21:01:37 +02:00
Pierre-Louis Mercereau
bfcabe8e73 chore: clean 2022-06-24 23:17:29 +02:00
Pierre-Louis Mercereau
233a6e4bd6 refactor: simplify 2022-06-24 23:04:43 +02:00
Pierre-Louis Mercereau
577792b3d5 feat(storage): upload with admin secret 2022-06-24 22:51:34 +02:00
Pierre-Louis Mercereau
3ba026e7d7 chore: clean tests, add error code, improve types 2022-06-24 22:06:33 +02:00
Pierre-Louis Mercereau
fa740867c5 chore: lint 2022-06-24 14:09:40 +02:00
Pilou
30f4e53181 Merge pull request #746 from nhost/docs/fix-typo
docs: fix typo
2022-06-24 13:52:24 +02:00
Pierre-Louis Mercereau
a417c8468a chore: lockfile 2022-06-24 13:24:57 +02:00
Pierre-Louis Mercereau
2dc020a676 Merge branch 'main' into feat/file-upload 2022-06-24 12:57:46 +02:00
Pierre-Louis Mercereau
f49d14cc1b chore: lockfile 2022-06-24 12:44:54 +02:00
Pilou
5a141453f0 Merge pull request #745 from nhost/contributors-readme-action-wA3mZijrN6
contributors readme action update
2022-06-23 18:55:11 +02:00
Pierre-Louis Mercereau
788bb9c90d docs: fix typo 2022-06-23 18:53:24 +02:00
github-actions[bot]
09fa429125 contrib-readme-action has updated readme 2022-06-23 15:04:08 +00:00
Johan Eliasson
c505281250 Merge pull request #744 from MelodicCrypter/patch-1
Deleted typo error
2022-06-23 17:03:50 +02:00
Hugh Caluscusin
7ea5523375 Deleted typo error
Edited line 34, from "decvices" to "devices"
2022-06-23 22:57:53 +08:00
Pilou
c5cd6b1d7b Merge pull request #740 from nhost/contributors-readme-action-_AZSPBOfXF
contributors readme action update
2022-06-22 16:40:55 +02: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
Johan Eliasson
4107287c8e Merge pull request #741 from nhost/changeset-release/main
chore: update versions
2022-06-22 14:16:59 +02:00
github-actions[bot]
651c481874 chore: update versions 2022-06-22 12:10:47 +00:00
github-actions[bot]
90a7999346 contrib-readme-action has updated readme 2022-06-22 12:09:31 +00:00
Nuno Pato
b54b0c0743 Merge pull request #601 from nhost/feat/add-cdn-support-nhost-js
Add `subdomain` and `region` as options to `NhostClient`
2022-06-22 12:09:12 +00:00
Johan Eliasson
d07373d255 updated parameters for NhostClient 2022-06-22 13:46:13 +02:00
Nuno Pato
73c8fa1fb2 fix typo 2022-06-22 10:47:35 +00:00
Pilou
67f2622642 Merge pull request #739 from nhost/docs/move-hasura-auth
Remove hasura-auth from the reference documentation
2022-06-22 12:40:08 +02:00
Pierre-Louis Mercereau
780f95d950 chore: update versions 2022-06-22 12:34:31 +02:00
Pierre-Louis Mercereau
cb84db7688 docs: remove hasura-auth from reference documentation 2022-06-22 12:31:24 +02:00
Johan Eliasson
67d76ebbb6 Merge pull request #737 from nhost/elitan-patch-2
Added ROSS Index badge
2022-06-22 10:11:26 +02:00
Johan Eliasson
48af3fb4d1 Update README.md 2022-06-22 09:26:21 +02:00
Johan Eliasson
e5adc515d4 Update README.md 2022-06-22 09:25:12 +02:00
Pilou
5f4b16f2f9 Merge pull request #716 from nhost/docs-algolio-fix
Fix Algolia full page search
2022-06-21 19:02:15 +02:00
Nuno Pato
be50d4ad1d Merge branch 'main' into feat/add-cdn-support-nhost-js 2022-06-21 15:09:07 +00:00
Nuno Pato
d40afbb744 Fix messaging 2022-06-21 15:04:35 +00:00
Nuno Pato
7e0035a856 Merge pull request #733 from nhost/chore/bump-all-versions
Bump all versions of hasura, hasura auth, and hasura storage
2022-06-21 14:12:56 +02:00
Pilou
2fec74e501 Merge pull request #717 from nhost/changeset-release/main
chore: update versions
2022-06-21 14:10:10 +02:00
Pierre-Louis Mercereau
e94b28b3bc chore: avoid major bumps of peer dependencies 2022-06-21 13:54:06 +02:00
github-actions[bot]
f591f76256 chore: update versions 2022-06-21 11:42:44 +00:00
Pilou
58fb955dc6 Merge pull request #720 from nhost/docs/vue-use-reset-password
docs(vue): correct useResetPassword inline example
2022-06-21 13:41:33 +02:00
Nuno Pato
5826baa57e Update missing packages 2022-06-21 10:26:25 +00:00
Nuno Pato
3c789629a4 Bump all versions of hasura, hasura auth, and hasura storage 2022-06-21 09:47:24 +00:00
Johan Eliasson
f472d42ae9 Merge pull request #732 from nhost/contributors-readme-action-RQTOlQZRpc
contributors readme action update
2022-06-21 07:39:06 +02:00
github-actions[bot]
9993bea7ab contrib-readme-action has updated readme 2022-06-21 05:22:34 +00:00
Johan Eliasson
6f33fc6ce6 Merge pull request #728 from nhost/contributors-readme-action-0KCGh0rhTk
contributors readme action update
2022-06-21 07:22:16 +02:00
Johan Eliasson
b6858c5638 Merge pull request #731 from nhost/contributors-readme-action-yVNIRBZEXT
contributors readme action update
2022-06-21 07:20:27 +02:00
github-actions[bot]
9b01c3ba93 contrib-readme-action has updated readme 2022-06-21 05:19:56 +00:00
Johan Eliasson
fcfd6a9c13 Merge pull request #729 from kylehayes/patch-1
Clarifying how to open Hasura Console
2022-06-21 07:19:41 +02:00
Kyle Hayes
e4daefe637 Clarifying how to open Hasura Console
Updating the documentation to reflect the new location of the button to open Hasura Console.
2022-06-20 17:45:07 -07:00
Guido Curcio
59a5fe97b1 chore: change from types to inferface; fix example; add test missing region test. 2022-06-20 11:20:27 -03:00
github-actions[bot]
a0bcbb6269 contrib-readme-action has updated readme 2022-06-20 13:16:03 +00:00
Pilou
1ec1004507 Merge pull request #727 from muttenzer/docs/permission-variables
Correct permission variables section
2022-06-20 15:15:40 +02:00
Pierre-Louis Mercereau
756d996096 chore: changeset 2022-06-20 12:16:30 +02:00
Timo
c0f1d03c3c Correct permission variables section
Mention how Nhost prefixes the custom JWT claims locally and correct example path.
2022-06-19 16:52:43 +02:00
Pilou
af55789d07 Merge pull request #723 from nhost/contributors-readme-action-IeghAq7Be4
contributors readme action update
2022-06-18 08:11:22 +02:00
Pilou
cb28676895 Merge pull request #722 from nhost/contributors-readme-action-8WdPB9amrq
contributors readme action update
2022-06-18 08:10:11 +02:00
github-actions[bot]
939a3d1090 contrib-readme-action has updated readme 2022-06-18 06:08:16 +00:00
Pilou
0163d0588b Merge pull request #721 from nhost/contributors-readme-action--AZAZ22Nlk
contributors readme action update
2022-06-18 08:08:02 +02:00
github-actions[bot]
c4124f22b0 contrib-readme-action has updated readme 2022-06-18 06:06:29 +00:00
Pilou
7188b0971c Merge pull request #718 from nhost/remove-build-script-dashes
chore: remove build script dashes
2022-06-18 08:06:16 +02:00
github-actions[bot]
6ac969320c contrib-readme-action has updated readme 2022-06-18 05:56:16 +00:00
Johan Eliasson
414bc2e75b Merge pull request #719 from muttenzer/docs/permission-variables
Update permission variables section
2022-06-18 07:56:00 +02:00
Pierre-Louis Mercereau
6862e1e24d docs(vue): correct useResetPassword inline example 2022-06-18 07:04:33 +02:00
muttenzer
4b9deaa2f7 Update permission variables section
Further instructions of how to handle custom permission variables in development.
2022-06-17 23:53:05 +02:00
Pierre-Louis Mercereau
cf366cef35 chore: remove build script dashes 2022-06-17 21:02:44 +02:00
Pilou
00d041f6b4 Merge pull request #714 from nhost/test/anonymous
test: anonymous sign-in and deanonymisation
2022-06-17 19:53:50 +02:00
Pierre-Louis Mercereau
da06fef64e refactor: use aria-label 2022-06-17 15:07:51 +02:00
Pierre-Louis Mercereau
09be9582f8 Merge branch 'main' into test/anonymous 2022-06-17 15:02:50 +02:00
Pilou
6b26fed8ae Merge pull request #713 from nhost/complete-mfa
Complete email+password sign-in with MFA
2022-06-17 15:02:08 +02:00
Pierre-Louis Mercereau
5a62c66fc4 Merge branch 'main' into test/anonymous 2022-06-17 14:26:17 +02:00
Pilou
17e0e6d116 Merge pull request #711 from nhost/test/change-email-password
test: change email and password
2022-06-17 14:22:02 +02:00
Pierre-Louis Mercereau
938000e61b test: don't accept an invalid email/password 2022-06-17 11:53:47 +02:00
Pierre-Louis Mercereau
d700107222 test: add apollo tests 2022-06-17 11:12:13 +02:00
Johan Eliasson
7f1b8a5881 config update 2022-06-17 08:38:17 +02:00
Johan Eliasson
7fd5f0fedf added initialIndexSettings 2022-06-17 08:33:14 +02:00
Johan Eliasson
bf551fe705 update 2022-06-17 08:24:00 +02:00
Pierre-Louis Mercereau
69d9e40187 chore: chore 2022-06-16 15:40:55 +02:00
Pierre-Louis Mercereau
fc5b18fdf0 test: add item to todo list when anonymous 2022-06-15 20:55:37 +02:00
Pierre-Louis Mercereau
fa3eb980a0 feat: allow anonymous users to use the todo list 2022-06-15 19:03:47 +02:00
Pierre-Louis Mercereau
efad3a2b08 chore: add comment 2022-06-15 17:20:42 +02:00
Pierre-Louis Mercereau
563fa4fe9b test: anonymous sign-in and deanonymisation 2022-06-15 17:19:09 +02:00
Pierre-Louis Mercereau
6f0a30059a feat: complete email+password sign-in with MFA 2022-06-15 13:37:52 +02:00
Pierre-Louis Mercereau
47cda5d716 chore: order 2022-06-15 10:08:09 +02:00
Pierre-Louis Mercereau
3f625ce9e1 test: change email and password 2022-06-15 10:03:23 +02:00
Pilou
38d2609249 Merge pull request #710 from nhost/roles-docs
Info about allowed roles
2022-06-15 09:10:56 +02:00
Pilou
030243cd45 Merge pull request #691 from nhost/e2e-react-tests
test: passwordless email, sign-in with token, sign-out
2022-06-15 09:08:32 +02:00
Johan Eliasson
c1905243d0 roles info 2022-06-14 22:40:15 +02:00
Johan Eliasson
37627cc50e info about allowed roles 2022-06-14 21:44:14 +02:00
Pierre-Louis Mercereau
009f68d500 test: should get a session from localStorage 2022-06-14 17:44:35 +02:00
Pierre-Louis Mercereau
b752cc2be8 test: add assertions 2022-06-13 18:35:43 +02:00
Pierre-Louis Mercereau
72fc7d4e44 Merge branch 'main' into e2e-react-tests 2022-06-13 09:31:26 +02:00
Pierre-Louis Mercereau
d20bfe3431 refactor: move files machines to hasura-storage-js, and prepare tests 2022-06-13 09:29:09 +02:00
Pilou
80ef14e50a Merge pull request #700 from nhost/react-example-todo-list
docs: replace the `books` table by a `todos` table
2022-06-13 08:23:55 +02:00
Pilou
543ea2a0e7 Merge pull request #706 from nhost/changeset-release/main
chore: update versions
2022-06-12 21:58:05 +02:00
github-actions[bot]
6764d476fd chore: update versions 2022-06-12 19:42:37 +00:00
Pilou
7bed0eadc9 Merge pull request #704 from nhost/fix/vue-nested-unref
Correct use of ref values in action options
2022-06-12 21:41:41 +02:00
Pierre-Louis Mercereau
c7644ace34 test: should return the same value when not a ref 2022-06-11 22:05:41 +02:00
Pierre-Louis Mercereau
49cdb2843e test: add one test 2022-06-11 21:58:03 +02:00
Pierre-Louis Mercereau
6f45856c46 fix: nestedUnref 2022-06-11 21:54:21 +02:00
Pierre-Louis Mercereau
dcf5e28e06 test: remove unecessary assertions 2022-06-10 21:49:24 +02:00
Pierre-Louis Mercereau
5c10169972 test: add single/multiple file upload tests 2022-06-10 21:46:47 +02:00
Pierre-Louis Mercereau
abdbbe6fcc Merge remote-tracking branch 'origin/e2e-react-tests' into feat/file-upload 2022-06-10 20:28:55 +02:00
Pierre-Louis Mercereau
61e719eea0 refactor: use findByRole 2022-06-10 18:37:13 +02:00
Pilou
208bdbba2d Merge pull request #703 from nhost/docs/fix-dependency
Use internal `*` dependencies in examples
2022-06-10 17:31:19 +02:00
Pierre-Louis Mercereau
cd62e1e833 docs: use internal * dependencies in examples 2022-06-10 16:47:32 +02:00
Pierre-Louis Mercereau
1dfb11d7e8 Merge branch 'e2e-react-tests' into react-example-todo-list 2022-06-10 14:30:07 +02:00
Pierre-Louis Mercereau
8b5c4ed443 refactor: make tests independent from each other 2022-06-10 14:28:03 +02:00
Szilárd Dóró
b60cd0411b Merge pull request #697 from nhost/changeset-release/main
chore: update versions
2022-06-10 12:56:52 +02:00
Pierre-Louis Mercereau
6bd5c96ed5 chore: modify autogenerated down migration 2022-06-10 11:58:52 +02:00
Pierre-Louis Mercereau
6b8762a62e chore: add missing change 2022-06-10 11:56:37 +02:00
Pierre-Louis Mercereau
ddeff7cbd6 refactor: rename index name 2022-06-10 11:55:17 +02:00
Pierre-Louis Mercereau
ed952c1251 perf: add index 2022-06-10 11:53:30 +02:00
Pierre-Louis Mercereau
34e73f18bd chore: remove .vscode directory 2022-06-10 11:44:12 +02:00
Pierre-Louis Mercereau
84262a24f1 docs: replace the books table by a todos table
adapt the Apollo page to add a todo item, add permissions so the connected user only sees its own
todos, add cypress test, use GraphQL codegen
2022-06-10 11:33:12 +02:00
Pierre-Louis Mercereau
ec2a88d69c chore: remove useless line 2022-06-09 11:40:22 +02:00
Pierre-Louis Mercereau
fe1049df6b test: token should be refresh on time 2022-06-09 11:39:18 +02:00
Pierre-Louis Mercereau
a924d21815 Merge remote-tracking branch 'origin/main' into e2e-react-tests 2022-06-09 09:09:03 +02:00
Pierre-Louis Mercereau
503339e5a8 chore: correct peer deps versions from major to minor bump 2022-06-09 08:55:32 +02:00
Pierre-Louis Mercereau
4405535d4a chore: adjustments 2022-06-09 08:43:08 +02:00
github-actions[bot]
6d031e7484 chore: update versions 2022-06-09 06:27:05 +00:00
Pilou
e80c7b629a Merge pull request #582 from nhost/anonymous-users
Anonymous users
2022-06-09 08:26:05 +02:00
Pierre-Louis Mercereau
479a2ed08d Merge remote-tracking branch 'origin/main' into feat/file-upload 2022-06-08 21:52:21 +02:00
Pierre-Louis Mercereau
7a469e1e1e Merge remote-tracking branch 'origin/main' into anonymous-users 2022-06-08 21:40:40 +02:00
Pierre-Louis Mercereau
af15771517 test: simulate network errors on sign-un and sign-in 2022-06-08 16:01:09 +02:00
Johan Eliasson
9b28e1329a Merge pull request #692 from nhost/auth-settings-name-update
docs: update login settings to authentication settings
2022-06-08 15:53:18 +02:00
Pierre-Louis Mercereau
c066ea5b75 ci: tranform package name into a valid file name 2022-06-08 14:05:11 +02:00
Pierre-Louis Mercereau
80e42b939b make it fail 2022-06-08 13:36:19 +02:00
Pierre-Louis Mercereau
3ea6f685e2 Merge remote-tracking branch 'origin/main' into e2e-react-tests 2022-06-08 13:27:57 +02:00
Pierre-Louis Mercereau
ac77f427c3 Merge remote-tracking branch 'origin/main' into e2e-react-tests 2022-06-08 13:01:46 +02:00
Pierre-Louis Mercereau
0f95ee5bb4 chore: rename 2022-06-08 11:26:41 +02:00
Johan Eliasson
4b572c4f58 update login settings to authentication settings 2022-06-08 11:25:47 +02:00
Pierre-Louis Mercereau
47406d3617 test: passwordless email, sign-in with token, sign-out 2022-06-08 11:24:18 +02:00
Pierre-Louis Mercereau
125bc9a749 test: passwordless email, sign-in with token, sign-out 2022-06-08 11:14:50 +02:00
Pilou
df29c8f98d Merge pull request #681 from nhost/test/ci
CI: end-to-end tests
2022-06-08 09:59:38 +02:00
Pilou
a08c3ec2d1 Merge pull request #690 from nhost/docs/vue-useSignOut
docs: add `useSignOut` inline example in `@nhost/vue`
2022-06-08 09:58:38 +02:00
Pierre-Louis Mercereau
fef034aa6e docs: adjust 2022-06-08 08:56:24 +02:00
Pierre-Louis Mercereau
7037af8ae6 docs: add useSignOut inline example in @nhost/vue 2022-06-07 21:47:44 +02:00
Pilou
477b48f184 Merge pull request #689 from nhost/contributors-readme-action-D3RyXdsQsy
contributors readme action update
2022-06-07 15:30:13 +02:00
Pierre-Louis Mercereau
33ac09fa40 ci: correct codecov url 2022-06-07 14:50:38 +02:00
Pierre-Louis Mercereau
92d66b9413 ci: include coverage as an output 2022-06-07 14:45:56 +02:00
Pierre-Louis Mercereau
9eb9b590f9 debug2 2022-06-07 14:20:41 +02:00
Pierre-Louis Mercereau
7edca99d48 debug 2022-06-07 14:19:25 +02:00
Pierre-Louis Mercereau
964cc6ded3 ci: don't redact vercel team 2022-06-07 14:12:32 +02:00
Pierre-Louis Mercereau
a69e0032bf ci: add comment to test turborepo cache + codecov 2022-06-07 14:01:03 +02:00
github-actions[bot]
86fbf934d6 contrib-readme-action has updated readme 2022-06-07 11:00:16 +00:00
Johan Eliasson
0d6ecd8397 Merge pull request #688 from nhost/contributors-readme-action-C3ZlKRvXQT
contributors readme action update
2022-06-07 13:00:00 +02:00
github-actions[bot]
56b57b2878 contrib-readme-action has updated readme 2022-06-07 10:59:11 +00:00
Johan Eliasson
e79ee93fde Merge pull request #686 from nhost/contributors-readme-action-1LPJf9w-v5
contributors readme action update
2022-06-07 12:58:58 +02:00
Johan Eliasson
7cec42b392 Merge pull request #683 from nhost/contributors-readme-action-PH9phwd1Bo
contributors readme action update
2022-06-07 12:58:42 +02:00
github-actions[bot]
f254c329f5 contrib-readme-action has updated readme 2022-06-07 10:58:28 +00:00
Johan Eliasson
2a84a025d5 Merge pull request #685 from nhost/contributors-readme-action-iIoqZk95q5
contributors readme action update
2022-06-07 12:58:14 +02:00
github-actions[bot]
c2b0625c31 contrib-readme-action has updated readme 2022-06-07 10:57:57 +00:00
Johan Eliasson
e80384c7ee Merge pull request #684 from nhost/timpratim-patch-1
Update event-triggers.mdx
2022-06-07 12:57:40 +02:00
Pratim
8fa4813b4e Update event-triggers.mdx
Added "t" to even
2022-06-07 16:07:54 +05:30
github-actions[bot]
d4c2e9eb78 contrib-readme-action has updated readme 2022-06-07 10:17:33 +00:00
Pilou
557d1a69b3 Merge pull request #682 from nhost/timpratim-patch-1
Update index.mdx
2022-06-07 12:17:16 +02:00
Pratim
4b811d939e Update index.mdx
Corrected the spelling of intuitive
2022-06-07 15:34:12 +05:30
Pierre-Louis Mercereau
f2a25b688d Merge branch 'main' into test/ci 2022-06-07 11:21:18 +02:00
Pierre-Louis Mercereau
e9c82d8609 ci: remove 'test/ci' from the gh workflow 2022-06-07 11:20:11 +02:00
Pierre-Louis Mercereau
853527a770 Merge branch 'main' into test/ci 2022-06-07 11:19:07 +02:00
Pilou
9e6e05c1b2 Merge pull request #663 from nhost/test/react-apollo
e2e tests: groundwork on the react-apollo example
2022-06-07 11:17:42 +02:00
Pierre-Louis Mercereau
85b5d89dbd chore: merge from main 2022-06-07 11:09:32 +02:00
Pilou
d22885f6b7 Merge pull request #680 from plmercereau/test/ci
Test/ci
2022-06-07 11:01:46 +02:00
Pierre-Louis Mercereau
5944b25e7e rename ci script to e2e 2022-06-07 11:00:57 +02:00
Pierre-Louis Mercereau
52fc5d3123 summary 2022-06-07 10:04:20 +02:00
Pierre-Louis Mercereau
7e0608f5ca ci: codecov 2022-06-07 09:57:55 +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
Pierre-Louis Mercereau
8876819687 docs: inline explanation of the tests GH workflow 2022-06-06 20:11:06 +02:00
Pilou
635d82b18f Merge pull request #678 from nhost/changeset-release/main
chore: update versions
2022-06-06 19:02:34 +02:00
github-actions[bot]
6a1def9b86 chore: update versions 2022-06-06 16:29:21 +00:00
Pilou
2cc075f4ef Merge pull request #677 from nhost/fix/subscription-headers
fix: add headers to subscription when creating the Apollo client
2022-06-06 18:28:27 +02:00
Pierre-Louis Mercereau
bbe6750632 chore: rephrase changeset 2022-06-06 18:28:08 +02:00
Johan Eliasson
19149261aa Merge pull request #676 from nhost/docs-emails-b8as9d
Docs abut emails with CLI
2022-06-06 13:59:08 +02:00
Pierre-Louis Mercereau
8b2d1b00a1 fix: add headers to subscription when creating the Apollo client 2022-06-06 13:34:27 +02:00
Johan Eliasson
3231e31c3e docs abuot emails with CLI 2022-06-06 08:08:09 +02:00
Pierre-Louis Mercereau
be1ef6fe79 ci: cosmetics: ann install step name 2022-06-05 23:06:55 +02:00
Pierre-Louis Mercereau
5a963832e2 ci: clean gh action and workflow 2022-06-05 23:05:52 +02:00
Pierre-Louis Mercereau
aa3f5c243c ci: disable fail-fast 2022-06-05 22:56:54 +02:00
Pierre-Louis Mercereau
5dce0f0fdc ci: make e2e test work locally 2022-06-05 22:49:46 +02:00
Pierre-Louis Mercereau
3c0e9fbb84 Merge branch 'plmercereau-test/ci' into test/ci 2022-06-05 22:19:54 +02:00
Pierre-Louis Mercereau
6c202304b2 Merge branch 'test/ci' of https://github.com/plmercereau/nhost into plmercereau-test/ci 2022-06-05 22:19:34 +02:00
Pierre-Louis Mercereau
50dcf41e6c ci: unit tests, e2e and lint 2022-06-05 22:14:13 +02:00
Pierre-Louis Mercereau
d6b4f83e16 ci: return json as a single line 2022-06-04 11:27:00 +02:00
Pierre-Louis Mercereau
ba86ae229d ci: include hasura-auth-js to e2e, and improve gh action 2022-06-04 11:14:30 +02:00
Pierre-Louis Mercereau
96f41ad0de ci: rename ci to test:ci 2022-06-03 22:41:25 +02:00
Pierre-Louis Mercereau
aba0c8b2da refactor: readability, and remove obsolete script 2022-06-03 22:36:53 +02:00
Pierre-Louis Mercereau
a27eeeab8e ci: improve readability 2022-06-03 22:30:06 +02:00
Pierre-Louis Mercereau
61a746e674 ci: only build example dependencies 2022-06-03 22:21:52 +02:00
Pierre-Louis Mercereau
7f37c87929 ci: add build step 2022-06-03 22:08:22 +02:00
Pierre-Louis Mercereau
3322c4b795 ci: convert list to stringified json and remove presumably useless steps 2022-06-03 22:04:19 +02:00
Pierre-Louis Mercereau
1e70c7e7a5 ci: gh actions matrix 2022-06-03 21:57:07 +02:00
Pierre-Louis Mercereau
9fbbdca60d chore: check new gh action runs on separate branch 2022-06-03 20:28:32 +02:00
Pilou
f7a3136086 Merge pull request #670 from nhost/changeset-release/main
chore: update versions
2022-06-03 20:06:20 +02:00
github-actions[bot]
b5642586a4 chore: update versions 2022-06-03 14:00:05 +00:00
Pilou
cadc8f8864 Merge pull request #667 from nhost/662-invalid-url-when-using-google-provider
fix: correct rewriting options when `clientUrl` is not available
2022-06-03 15:58:17 +02:00
Pierre-Louis Mercereau
1dc2bce05a refactor: add tests and inline docs 2022-06-03 14:41:15 +02:00
Pilou
65588268f6 Merge pull request #669 from nhost/contributors-readme-action-hUXZuGw8l3
contributors readme action update
2022-06-03 13:37:21 +02:00
github-actions[bot]
a6b15bb387 contrib-readme-action has updated readme 2022-06-03 10:07:07 +00:00
Pilou
7b8f64ab25 Merge pull request #668 from nbourdin/patch-2
Update github-integration.mdx
2022-06-03 12:06:50 +02:00
Nicolas Bourdin
451b62d641 Update github-integration.mdx 2022-06-03 12:05:04 +02:00
Pierre-Louis Mercereau
d843f1a3ed refactor: use testing-library and other adjustments 2022-06-03 12:00:17 +02:00
Pierre-Louis Mercereau
08a37aae7c fix: correct rewriting options when clientUrl is not available
The client URL is set to `window.location.origin`, so it can rewrite redirection urls that are
passed on to authenticaion methods. However, `clientUrl` is set to `''` when running on the server
side. This fix then avoid raising an error when trying to rewrite `redirectTo` on non-browser
environment, and forces `useProviderLink` to be rendered on the client side.
2022-06-03 11:41:52 +02:00
Pierre-Louis Mercereau
464a10fa06 refactor: replace 'workspace:*' by '*' in react-apollo example 2022-06-03 08:42:24 +02:00
Pierre-Louis Mercereau
2cb1c36c76 chore: remove line from .eslint.base.js (merge mistake), remove eslintrc in example folder 2022-06-02 21:35:04 +02:00
Pierre-Louis Mercereau
b4670024ca Merge branch 'main' into test/react-apollo 2022-06-02 21:13:20 +02:00
Pierre-Louis Mercereau
feb616ecc0 test: mvp 2022-06-02 21:05:03 +02:00
Johan Eliasson
679c32cb5a Merge pull request #658 from nhost/docs-storage
Docs: Storage and small fixes
2022-06-02 17:03:13 +02:00
Johan Eliasson
25bc2bee67 small updates 2022-06-02 15:34:17 +02:00
Szilárd Dóró
ce1ea16981 Merge pull request #661 from nhost/changeset-release/main
chore: update versions
2022-06-02 12:50:27 +02:00
github-actions[bot]
7048eaf0bb chore: update versions 2022-06-02 10:47:48 +00:00
Szilárd Dóró
9c382a3773 Merge pull request #660 from nhost/fix/esm-rollback
chore: reverted ESM related changes
2022-06-02 12:46:57 +02:00
Johan Eliasson
7f07c75dc4 Merge pull request #659 from gdangelo/docs/quickstarts-nextjs
docs: Add skip option to useQuery call to skip query if id is falsy
2022-06-02 12:44:13 +02:00
Szilárd Dóró
ebad09364e added changeset 2022-06-02 12:43:40 +02:00
Szilárd Dóró
cbec4dbab6 chore: reverted ESM related changes
ESM gods didn't like me 😞 we'll come back to this in the future
2022-06-02 11:26:23 +02:00
Johan Eliasson
a05d7585a3 typo 2022-06-02 10:51:15 +02:00
Johan Eliasson
89f823fdce stronger 2022-06-02 10:50:08 +02:00
Johan Eliasson
6f4d465f54 main repo 2022-06-02 10:48:23 +02:00
Johan Eliasson
aafbaa8d25 update 2022-06-02 10:37:47 +02:00
Johan Eliasson
0f7b31497f storage update 2022-06-02 09:33:36 +02:00
Grégory D'Angelo
bcf2751625 docs: Add skip option to useQuery call to skip query if id is falsy 2022-06-02 09:20:53 +02:00
Johan Eliasson
1965fc85d6 storage started 2022-06-02 08:30:46 +02:00
Johan Eliasson
a8a7c32ec1 better docs for magic link and sms 2022-06-02 07:21:36 +02:00
Johan Eliasson
e8232cdfbb better phone number sign in docs 2022-06-02 07:14:28 +02:00
Johan Eliasson
066489e3d4 zoom images 2022-06-02 07:00:34 +02:00
Johan Eliasson
de10d84cc1 started 2022-06-01 23:24:11 +02:00
Pierre-Louis Mercereau
7bc6d231b8 chore: cypress example 2022-06-01 18:24:07 +02:00
Szilárd Dóró
f7ddafdf05 Merge pull request #657 from nhost/changeset-release/main
chore: update versions
2022-06-01 15:26:43 +02:00
github-actions[bot]
f86b707d34 chore: update versions 2022-06-01 13:23:25 +00:00
Szilárd Dóró
d281665424 Merge pull request #655 from nhost/fix/missing-modules
fix: `@nhost/react-apollo` imports
2022-06-01 15:22:21 +02:00
Szilárd Dóró
24659b2979 fixed build warning related to unknown globals 2022-06-01 14:52:36 +02:00
Szilárd Dóró
ef8c8f9cd4 fixed @nhost/react-apollo imports 2022-06-01 14:47:04 +02:00
Pierre-Louis Mercereau
84e72f1d8d chore: install cypress and adjust eslint 2022-06-01 14:36:15 +02:00
Johan Eliasson
bc526e70ef Merge pull request #651 from gdangelo/docs/quickstarts-redwoodjs
docs: Add skip option to useQuery call to skip query if id is falsy
2022-06-01 14:30:23 +02:00
Szilárd Dóró
35068d213f Merge pull request #652 from nhost/changeset-release/main
chore: update versions
2022-06-01 13:42:31 +02:00
Pilou
e732ea9aa5 Merge pull request #650 from gdangelo/docs/quickstarts-react
docs: Add skip option to useQuery call to skip query if id is falsy
2022-06-01 13:40:35 +02:00
github-actions[bot]
e8d5338aca chore: update versions 2022-06-01 11:39:36 +00:00
Szilárd Dóró
ac84f4d0e9 Merge pull request #648 from nhost/fix/next-esm-followup
ESM and build process improvements
2022-06-01 13:38:05 +02:00
Szilárd Dóró
12e9a572db activated import/extensions ESLint rule
- file extensions are mandatory for imported packages
- fixed general errors indicated by the linter
2022-06-01 13:31:09 +02:00
Grégory D'Angelo
c1c7ceb319 docs: Add skip option to useQuery call to skip query if id is falsy 2022-06-01 13:20:41 +02:00
Grégory D'Angelo
23a9f9f547 docs: Add skip option to useQuery call to skip query if id is falsy 2022-06-01 11:43:27 +02:00
Pierre-Louis Mercereau
3db941eb46 Merge branch 'main' into feat/file-upload 2022-06-01 11:22:50 +02:00
Pierre-Louis Mercereau
42a7aaf916 add doc link 2022-06-01 11:04:13 +02:00
Szilárd Dóró
1b37b9f62a added changeset 2022-06-01 10:37:25 +02:00
Szilárd Dóró
764ea72d60 fixed build warning about globals 2022-06-01 09:42:06 +02:00
Pilou
3efbbca136 Merge pull request #646 from nhost/plmercereau-patch-1
Remove AUTH_SMS_TWILIO_FROM from env var list
2022-06-01 09:01:24 +02:00
Pilou
93d8eec950 Remove AUTH_SMS_TWILIO_FROM from env var list 2022-06-01 08:46:49 +02:00
Szilárd Dóró
d4ea2fce6d fixed React ESM issues, simplified bundle copy 2022-05-31 23:08:48 +02:00
Pierre-Louis Mercereau
2443399cdc Merge branch 'main' into feat/file-upload 2022-05-31 20:35:43 +02:00
Nuno Pato
b8f4b75b0c Add changeset 2022-05-31 17:43:45 +02:00
Nuno Pato
5227c84820 Merge branch 'main' into feat/add-cdn-support-nhost-js 2022-05-31 17:32:47 +02:00
Johan Eliasson
5096456f78 Merge pull request #643 from nhost/elitan-patch-2
Light mode for now to match landing page and dashboard
2022-05-31 17:08:01 +02:00
Johan Eliasson
507d09861c Light mode for now to match landing page and dashboard 2022-05-31 16:32:25 +02:00
Szilárd Dóró
050cb288fc Merge pull request #642 from nhost/changeset-release/main
chore: update versions
2022-05-31 16:22:55 +02:00
github-actions[bot]
cd120c61fb chore: update versions 2022-05-31 14:19:38 +00:00
Szilárd Dóró
5ddb5a751b Merge pull request #640 from nhost/fix/next-esm-bundling 2022-05-31 16:18:20 +02:00
Johan Eliasson
92209b6690 Merge pull request #641 from nhost/contributors-readme-action-A3l1kugNkY
contributors readme action update
2022-05-31 16:04:08 +02:00
github-actions[bot]
bdb11c0fa4 contrib-readme-action has updated readme 2022-05-31 14:02:31 +00:00
Johan Eliasson
63c3e7cb2c Merge pull request #639 from nhost/contributors-readme-action-Dh3J_t5dMB
contributors readme action update
2022-05-31 16:02:09 +02:00
Szilárd Dóró
78341491cd fixed ESM related errors, updated ESM file names 2022-05-31 15:19:42 +02:00
github-actions[bot]
cd8560e6d3 contrib-readme-action has updated readme 2022-05-31 13:14:37 +00:00
Johan Eliasson
fced43f55d Merge pull request #638 from nhost/contributors-readme-action-bW8QNtGd78
contributors readme action update
2022-05-31 15:14:19 +02:00
github-actions[bot]
47cc5d1562 contrib-readme-action has updated readme 2022-05-31 12:42:26 +00:00
Johan Eliasson
9ab4d49421 Merge pull request #616 from mdp18/docs-react-nhost-fix
docs clarification for nhost instance
2022-05-31 14:42:12 +02:00
Johan Eliasson
4bdd29c2ea Merge branch 'main' into docs-react-nhost-fix 2022-05-31 14:41:48 +02:00
Johan Eliasson
a43fa284b4 Merge pull request #637 from nhost/docs-small-fixes
Docs: Small fixes
2022-05-31 14:40:59 +02:00
Johan Eliasson
e68ca9b0c8 Merge pull request #632 from nhost/docs-og-images
Docs: Open Graph Images
2022-05-31 14:40:40 +02:00
Johan Eliasson
ad26b8392f small fixes 2022-05-31 14:01:46 +02:00
Johan Eliasson
09ffcb961a slightly modified images 2022-05-31 13:56:43 +02:00
Johan Eliasson
42879a26da added img for all docs under platform 2022-05-31 13:49:26 +02:00
Johan Eliasson
cdba9aa5a0 no nextjs 2022-05-31 11:26:16 +02:00
Johan Eliasson
b092e13ba0 more images 2022-05-31 11:16:14 +02:00
Johan Eliasson
a2343c8ef2 small config updates 2022-05-31 10:57:03 +02:00
Szilárd Dóró
31cc558492 Merge pull request #610 from nhost/changeset-release/main
chore: update versions
2022-05-31 10:42:25 +02:00
Johan Eliasson
2cbe8a5045 dynamic url 2022-05-31 10:39:35 +02:00
github-actions[bot]
b6817f4c55 chore: update versions 2022-05-31 08:39:18 +00:00
Szilárd Dóró
41823e143f Merge pull request #633 from nhost/fix/bundling-follow-up
Package build improvements
2022-05-31 10:37:33 +02:00
Johan Eliasson
a38ddeed5e update 2022-05-31 10:35:49 +02:00
Szilárd Dóró
8b69be1baa changeset wording improvements 2022-05-31 10:32:17 +02:00
Szilárd Dóró
bc11c9e56a build related fixes: warnings, copying on Windows 2022-05-31 10:30:30 +02:00
Johan Eliasson
1fbf990c79 test image 2022-05-31 10:25:36 +02:00
Johan Eliasson
b942420b07 Merge pull request #621 from nhost/docs-auth-4
Docs: Authentication
2022-05-31 09:58:13 +02:00
Johan Eliasson
abbbf0b059 correct variables 2022-05-31 09:56:51 +02:00
Johan Eliasson
6121d2be45 updates 2022-05-31 09:52:46 +02:00
Johan Eliasson
6e8a3c9b56 nice looking directory tree 2022-05-31 09:50:06 +02:00
Szilárd Dóró
601e0237ed Merge pull request #623 from nhost/fix/esm-bundling
fix: Package bundling / Node.js environment
2022-05-31 09:40:28 +02:00
Johan Eliasson
7ccd051a41 info about custom permission variables 2022-05-31 09:39:19 +02:00
Johan Eliasson
7f7eebd75e jwt clarification 2022-05-31 09:34:50 +02:00
Johan Eliasson
c5a9fc568b Merge branch 'main' into docs-react-nhost-fix 2022-05-31 09:31:22 +02:00
Pilou
24833db254 Merge pull request #631 from nhost/628-docker-compose-file-not-working-with-nhosthasura-storage-v020
fix: docker-compose with hasura-storage 0.2
2022-05-31 08:49:52 +02:00
Pierre-Louis Mercereau
6f970ec18d fix: docker-compose with hasura-storage 0.2 2022-05-31 08:41:03 +02:00
Pierre-Louis Mercereau
de81942fb2 phrasing 2022-05-31 08:21:10 +02:00
Johan Eliasson
fe158a5334 Merge pull request #630 from nhost/contributors-readme-action-lw_Njvj3EE
contributors readme action update
2022-05-31 07:41:52 +02:00
github-actions[bot]
05fd36ce75 contrib-readme-action has updated readme 2022-05-31 05:35:53 +00:00
Johan Eliasson
e19818b262 Merge pull request #629 from atapas/patch-1
Corrected the yarn switch for installing express
2022-05-31 07:35:39 +02:00
Tapas Adhikary
dac7e16249 Corrected the yarn switch for installing express
The switch for yarn should `D`, not `d`.
2022-05-31 10:04:21 +05:30
Pierre-Louis Mercereau
5a60c5cb29 doc cleanup 2022-05-30 23:59:43 +02:00
Pierre-Louis Mercereau
752812a321 minor improvement 2022-05-30 23:53:07 +02:00
Pierre-Louis Mercereau
0af2337499 rename to bucketId 2022-05-30 23:46:10 +02:00
Pierre-Louis Mercereau
b238bd7b6b improve actions 2022-05-30 23:41:49 +02:00
Pierre-Louis Mercereau
f87403108f correct progress 2022-05-30 23:31:54 +02:00
Pilou
4708c36a05 Merge pull request #627 from nhost/contributors-readme-action-baAdE7ragJ
contributors readme action update
2022-05-30 23:01:17 +02:00
Pierre-Louis Mercereau
20f8fe9eb4 correct inline doc 2022-05-30 22:48:56 +02:00
github-actions[bot]
a1f4e9146a contrib-readme-action has updated readme 2022-05-30 20:47:17 +00:00
Pilou
b0d0577800 Merge pull request #626 from nbourdin/patch-1
Update serverless-functions.mdx
2022-05-30 22:47:04 +02:00
Pierre-Louis Mercereau
6f6044c49c forbid clearing list when uploading 2022-05-30 22:45:24 +02:00
Nicolas Bourdin
74a7feed45 Update serverless-functions.mdx 2022-05-30 22:42:10 +02:00
Pierre-Louis Mercereau
4ffb14b240 rename to useFileUploadItem 2022-05-30 22:23:25 +02:00
Pierre-Louis Mercereau
f9854b15c4 typo and changesets 2022-05-30 22:19:14 +02:00
Pierre-Louis Mercereau
cf206a4d1c inline documentation 2022-05-30 22:10:03 +02:00
Szilárd Dóró
2b2f8e91ae fixed bundling of packages to support Node.js environment 2022-05-30 21:57:41 +02:00
Pierre-Louis Mercereau
eae285bfc9 misc improvements 2022-05-30 21:47:13 +02:00
Pierre-Louis Mercereau
51a115eaf7 rename machine files and fix cancel action 2022-05-30 20:37:39 +02:00
Pierre-Louis Mercereau
da9c043fb5 reuse single file upload hook 2022-05-30 19:44:45 +02:00
Johan Eliasson
a729bc6cde Merge branch 'docs-auth-3' into docs-auth-4 2022-05-30 19:33:10 +02:00
Max
0b79b4f492 end ticks fix
fixed ``` end ticks from protected routes
2022-05-30 09:07:29 -07:00
Max
832702ff45 docs clarification v2
added review comments
2022-05-30 09:05:51 -07:00
Johan Eliasson
397748bd1f typo 2022-05-30 17:38:38 +02:00
Johan Eliasson
1026dfccb7 typos and updates 2022-05-30 17:37:52 +02:00
Pierre-Louis Mercereau
e821af279a error, cancellation, simplification 2022-05-30 17:36:27 +02:00
Johan Eliasson
e5d3066091 typo 2022-05-30 17:33:51 +02:00
Johan Eliasson
9847875752 updates 2022-05-30 17:33:26 +02:00
Johan Eliasson
8af9c880c9 correct links 2022-05-30 17:29:40 +02:00
Johan Eliasson
004c44cb80 auth docs updated 2022-05-30 17:00:57 +02:00
Pierre-Louis Mercereau
1d3469a455 Merge branch 'main' into feat/file-upload 2022-05-30 15:58:37 +02:00
Szilárd Dóró
33358e88f8 Merge pull request #618 from nhost/fix/docs-highlight-background
fix: Docusaurus highlight background color
2022-05-30 15:50:22 +02:00
Pierre-Louis Mercereau
05ced50d74 Merge branch 'main' into anonymous-users 2022-05-30 13:31:27 +02:00
Pilou
40facd73f7 Merge pull request #607 from nhost/refactor/react-files
refactor: simpler and more consistent file structure in @nhost/react
2022-05-30 13:17:55 +02:00
Pierre-Louis Mercereau
4c916a94f0 improve tests on anonymous users 2022-05-30 13:17:21 +02:00
Pierre-Louis Mercereau
a69a6d63e3 grammar 2022-05-30 13:16:33 +02:00
Pierre-Louis Mercereau
5abb2dda3f not(a and b) <=> not a and not b 2022-05-30 13:15:25 +02:00
Pierre-Louis Mercereau
5630c07a8a rename hook to composable 2022-05-30 11:47:19 +02:00
Pierre-Louis Mercereau
5c6239589c remove unused interface 2022-05-30 11:46:38 +02:00
Pierre-Louis Mercereau
028793d1a3 remove unnecessary useMemo 2022-05-30 11:37:15 +02:00
Pierre-Louis Mercereau
bc4c20592e export hook result interfaces 2022-05-30 11:35:51 +02:00
Szilárd Dóró
023a3cbef2 fix: Docusaurus highlight background color 2022-05-30 09:12:27 +02:00
Johan Eliasson
a8490b5a52 Merge pull request #613 from nhost/docs-react-clarification
Docs: React protected route clarification
2022-05-29 21:46:04 +02:00
Max
1791452fc2 docs clarification for nhost instance
Clarifying where nhost client instance should be made for ease of following and understanding the documentation. I think ultimately it should follow the steps shown subsequently.
2022-05-29 10:53:59 -07:00
Johan Eliasson
e390f99c43 updates 2022-05-29 19:21:14 +02:00
Johan Eliasson
0a9143a5b8 docs clarification 2022-05-29 19:13:36 +02:00
Johan Eliasson
4e9a47d229 Merge pull request #612 from nhost/contributors-readme-action-hUP1378npl
contributors readme action update
2022-05-29 18:50:47 +02:00
github-actions[bot]
fbec804d9e contrib-readme-action has updated readme 2022-05-29 15:34:04 +00:00
Pilou
a815678379 Merge pull request #611 from MelodicCrypter/MelodicCrypter-fix-docs-authentication-typo
Fixed typo error in Authentication/sign-in-methods page
2022-05-29 17:33:49 +02:00
Hugh Caluscusin
a2d4530e8a Fixed typo error 2022-05-29 21:49:19 +08:00
Pilou
c8b0269d6f Merge pull request #609 from nhost/feat/admin-secret
feat: new `adminSecret` option
2022-05-27 21:50:55 +02:00
Pierre-Louis Mercereau
2eed249826 post-review 2022-05-27 20:23:54 +02:00
Pierre-Louis Mercereau
88c74cc059 fix: add missing param 2022-05-27 19:37:02 +02:00
Pierre-Louis Mercereau
858014e42a feat: new adminSecret option 2022-05-27 19:12:39 +02:00
Pierre-Louis Mercereau
16b15802c7 chore: lint fix and clean 2022-05-27 09:59:45 +02:00
Pierre-Louis Mercereau
9ff668d26c feat: remove one or every file in multiple upload 2022-05-27 09:34:52 +02:00
Pierre-Louis Mercereau
8f100e6e56 refactor: get things prepared for the next @nhost/react file structure 2022-05-27 08:29:40 +02:00
Pierre-Louis Mercereau
1a6201f327 refactor: simpler and more consistent file structure
Keep the same logic as in Vue: 1 hook = 1 file, file name = hook name
2022-05-26 23:08:18 +02:00
Pierre-Louis Mercereau
42dc93100c feat(wip): file upload machines, hooks and example 2022-05-26 22:28:44 +02:00
Nuno Pato
04aadb6fa4 Add missing https 2022-05-25 19:04:22 +02:00
Nuno Pato
e08a08973d Test urlFromParams util function 2022-05-25 18:36:16 +02:00
Nuno Pato
3b11caf3bc Introduce types for backendUrl and subdomain 2022-05-25 17:11:01 +02:00
Johan Eliasson
cb1560594b Merge pull request #604 from nhost/package-readmes
basic package readmes
2022-05-25 11:13:06 +02:00
Pierre-Louis Mercereau
6fa70a6202 correct copy-paste 2022-05-25 09:31:04 +02:00
Nuno Pato
049f67e54a Improve messaging 2022-05-25 00:45:41 +02:00
Nuno Pato
6da1f90bc3 Add subdomain alongside backendUrl 2022-05-25 00:03:14 +02:00
Pierre-Louis Mercereau
93b6daf486 basic package readmes 2022-05-24 20:47:42 +02:00
Pierre-Louis Mercereau
9772a3b577 rephrase 2022-05-24 15:24:11 +02:00
Johan Eliasson
b35936c230 Merge pull request #596 from nhost/docs-graphql
docs: GraphQL, Permissions, GitHub Integration, Environment Variables
2022-05-24 14:17:00 +02:00
Johan Eliasson
45e536a1de docs improvements 2022-05-24 14:06:50 +02:00
Johan Eliasson
cb3b9d4c79 Merge pull request #600 from nhost/elitan-patch-2
Update README.md
2022-05-24 13:01:33 +02:00
Nuno Pato
59fd68dee3 Add region to the NhostClient constructor 2022-05-24 12:56:02 +02:00
Johan Eliasson
865f052674 Update README.md 2022-05-24 09:20:00 +02:00
Johan Eliasson
401fc2db9b Merge pull request #599 from nhost/oss-tagline
README updates
2022-05-24 09:15:30 +02:00
Johan Eliasson
00a641d20a header fix 2022-05-24 09:15:08 +02:00
Pilou
a64284a028 Merge pull request #598 from nhost/elitan-patch-2
Update vercel.json
2022-05-24 08:56:13 +02:00
Johan Eliasson
1fd42677a8 headers update 2022-05-23 22:28:16 +02:00
Johan Eliasson
0851a0a53d README updates 2022-05-23 22:25:27 +02:00
Johan Eliasson
3122c5e726 Update vercel.json 2022-05-23 22:16:37 +02:00
Johan Eliasson
f38a831405 updated env vars docs 2022-05-23 22:07:21 +02:00
Johan Eliasson
3a18239c71 workdings and headers 2022-05-23 21:47:00 +02:00
Johan Eliasson
4952cc9d7b small updates 2022-05-23 21:20:05 +02:00
Johan Eliasson
b13ddd087e updates 2022-05-23 21:18:46 +02:00
Johan Eliasson
01e9b609cf Merge pull request #597 from nhost/contributors-readme-action-ui0UBmK5hr
contributors readme action update
2022-05-23 21:03:33 +02:00
Johan Eliasson
d1068ea78a added github integration docs 2022-05-23 21:02:54 +02:00
github-actions[bot]
793672fd3d contrib-readme-action has updated readme 2022-05-23 18:13:47 +00:00
Johan Eliasson
577a108329 Merge pull request #595 from nhost/docs/add-missing-links
docs: add missing links
2022-05-23 20:13:31 +02:00
Johan Eliasson
7e49829d81 updates 2022-05-23 17:25:04 +02:00
Pierre-Louis Mercereau
b64fa32c8a docs: add missing links 2022-05-23 11:53:12 +02:00
Pilou
c63aaaf5ce Merge pull request #590 from Sonichigo/patch-1
fixed typo in documentation
2022-05-23 09:45:04 +02:00
Pilou
110ce6414c Merge pull request #593 from nhost/contributors-readme-action--vk6xBLD4J
contributors readme action update
2022-05-23 09:27:59 +02:00
Pilou
4df37cdefa Merge pull request #591 from nhost/contributors-readme-action-8a6nvMV_es
contributors readme action update
2022-05-23 09:27:11 +02:00
github-actions[bot]
d7a9e5c150 contrib-readme-action has updated readme 2022-05-23 07:26:53 +00:00
Pilou
c3bede4051 Merge pull request #592 from nhost/changeset-release/main
chore: update versions
2022-05-23 09:26:36 +02:00
github-actions[bot]
e2e87bd0b2 chore: update versions 2022-05-23 07:20:25 +00:00
github-actions[bot]
2270983eb9 contrib-readme-action has updated readme 2022-05-23 07:19:46 +00:00
Pilou
c6bc105a6c Merge pull request #589 from heygambo/feat/vue
🐛 imports from @apollo/client/core for vue
2022-05-23 09:19:31 +02:00
Pierre-Louis Mercereau
097e304f9f reflect changes in missing files and add changeset 2022-05-23 09:14:42 +02:00
Animesh Pathak
17ad0a21cc fixed typo in documentation 2022-05-23 06:59:04 +05:30
Christian Gambardella
fb34967ea6 🐛 imports from @apollo/client/core for vue
This fixes a bug where it's required to have react in a vue project.
@apollo/client exports code related to react.
@apollo/client/core does not not.

Ref: https://github.com/apollographql/apollo-client/blob/main/src/index.ts
2022-05-23 00:28:57 +02:00
Johan Eliasson
0f574d4c30 graphql first draft 2022-05-22 21:54:50 +02:00
Johan Eliasson
20ab24d227 Merge pull request #588 from nhost/contributors-readme-action-ABARDipKaO
contributors readme action update
2022-05-22 08:53:16 +02:00
github-actions[bot]
efd31f4bce contrib-readme-action has updated readme 2022-05-22 06:52:14 +00:00
Johan Eliasson
30da899832 Merge pull request #587 from leothorp/patch-1
Fix broken README.md doc links
2022-05-22 08:52:01 +02:00
Leo Thorp
d14b0d4644 Fix broken README.md doc links 2022-05-21 17:23:25 -05:00
Johan Eliasson
51d742b12c Merge pull request #581 from nhost/docs-database
Docs: Database and Event Triggers
2022-05-20 22:10:08 +02:00
Pilou
4f9b34a6a0 Merge pull request #585 from nhost/contributors-readme-action-H5QVIVxSRf
contributors readme action update
2022-05-20 21:56:19 +02:00
github-actions[bot]
640d4521e2 contrib-readme-action has updated readme 2022-05-20 19:54:39 +00:00
Pilou
8003dfed8b Merge pull request #573 from nhost/docs-structure
Docs: Top menu structure change
2022-05-20 21:54:24 +02:00
Johan Eliasson
972af7bab1 added base dir redirect 2022-05-20 21:40:24 +02:00
Johan Eliasson
2c35b02c83 Merge branch 'main' into docs-structure 2022-05-20 21:38:09 +02:00
Johan Eliasson
c8c2f50fca added redirects to blog posts 2022-05-20 21:36:42 +02:00
Johan Eliasson
3ef786392b more small updates 2022-05-20 16:12:23 +02:00
Johan Eliasson
b4b3c5edc2 small updates 2022-05-20 16:06:41 +02:00
Pierre-Louis Mercereau
5b69e6eccb refactor: lint 2022-05-20 14:17:00 +02:00
Pierre-Louis Mercereau
1ca5d34c80 revert: unnecessary renaming 2022-05-20 14:08:18 +02:00
Johan Eliasson
02fb3eaa91 event trigger updates 2022-05-20 14:01:14 +02:00
Pierre-Louis Mercereau
c161339423 chore: changesets and improvements 2022-05-20 13:56:59 +02:00
Pierre-Louis Mercereau
ab469fba84 Merge branch 'main' into anonymous-users 2022-05-20 13:07:04 +02:00
Pierre-Louis Mercereau
b122a306a4 feat: deanonymisation from a phone 2022-05-20 13:04:14 +02:00
Pierre-Louis Mercereau
d3a2eae789 refactor: merge email and signup states into a common registration state 2022-05-20 10:49:04 +02:00
Johan Eliasson
a5c21ed9f8 fix2 2022-05-20 10:14:50 +02:00
Johan Eliasson
a36843296a fix 2022-05-20 10:14:16 +02:00
Johan Eliasson
318b0c8d54 db updates 2022-05-20 09:05:48 +02:00
Johan Eliasson
2a684d3f84 Merge pull request #580 from nhost/fix/docgen-multiline-description
fix: Auto-generated documentation descriptions
2022-05-20 08:58:26 +02:00
Pierre-Louis Mercereau
3ac1694d1e Merge branch 'main' into anonymous-users 2022-05-20 08:44:36 +02:00
Johan Eliasson
0e870ad971 redirect cli URLs 2022-05-20 07:55:52 +02:00
Pilou
96a2c5f63f Merge pull request #578 from nhost/changeset-release/main
chore: update versions
2022-05-20 07:42:54 +02:00
Johan Eliasson
5dbad5feb2 Merge pull request #579 from nhost/hasura-diagram
Added Hasura to diagram
2022-05-20 06:27:46 +02:00
Pierre-Louis Mercereau
032743c750 refactor: consistent naming 2022-05-19 22:34:48 +02:00
Pierre-Louis Mercereau
5029c0b934 fix: corrections 2022-05-19 22:29:31 +02:00
Pierre-Louis Mercereau
7eb927b549 refactor: working and tested 2022-05-19 22:22:25 +02:00
Johan Eliasson
6bb43b2536 wrong branch.. 2022-05-19 18:46:48 +02:00
Johan Eliasson
7a13cb247f redirect cli urls 2022-05-19 18:44:21 +02:00
Szilárd Dóró
1521572f5f fixed #559
- Fixed typos in docs
- Updated wording of some TSDocs
2022-05-19 16:05:03 +02:00
Johan Eliasson
b8c150e6c3 updated diagram in docs too 2022-05-19 15:55:39 +02:00
Johan Eliasson
f9ad440114 updated diagram 2022-05-19 15:33:52 +02:00
Johan Eliasson
da6fab0767 updated diagram 2022-05-19 15:28:18 +02:00
Johan Eliasson
4b4181a073 added Hasura to diagram 2022-05-19 15:25:38 +02:00
Johan Eliasson
1fc001a31a Merge pull request #569 from gdangelo/docs/quickstarts-redwoodjs
Create new quickstart guide for RedwoodJS
2022-05-19 14:16:13 +02:00
github-actions[bot]
e150a6d212 chore: update versions 2022-05-19 12:13:26 +00:00
Johan Eliasson
083dc4865b Merge branch 'main' into docs-structure 2022-05-19 14:12:55 +02:00
Johan Eliasson
86c58f62d9 Merge pull request #576 from nhost/elitan-patch-2
typo
2022-05-19 14:12:40 +02:00
Johan Eliasson
a2d31c119b Merge branch 'main' into elitan-patch-2 2022-05-19 14:12:13 +02:00
Johan Eliasson
50a4c2d9b8 codegen 2022-05-19 14:10:57 +02:00
Johan Eliasson
29229734f0 actually, the URLs are the same :D 2022-05-19 14:08:39 +02:00
Johan Eliasson
5e1756681c redirects for moved urls 2022-05-19 14:06:58 +02:00
Pierre-Louis Mercereau
dbb29ac4d6 Merge branch 'main' into anonymous-users 2022-05-19 13:49:24 +02:00
Pilou
476c732935 Merge pull request #468 from nhost/feat/vue
Feat/vue
2022-05-19 13:46:58 +02:00
Pilou
d8d1423158 Merge pull request #577 from nhost/changeset-release/main
chore: update versions
2022-05-19 13:42:24 +02:00
Pierre-Louis Mercereau
260c2eb51a docs: typo 2022-05-19 13:34:18 +02:00
Pierre-Louis Mercereau
0348114d26 test: first anonymous user tests 2022-05-19 13:19:20 +02:00
Pierre-Louis Mercereau
e66c1689a4 Merge branch 'feat/vue' into anonymous-users 2022-05-19 13:03:29 +02:00
Pierre-Louis Mercereau
b2fae7c78f Merge branch 'main' into feat/vue 2022-05-19 12:56:03 +02:00
Pierre-Louis Mercereau
ad52223fde docs: make mdx component work with the latest docusaurus beta 2022-05-19 12:55:42 +02:00
github-actions[bot]
e95881089b chore: update versions 2022-05-19 10:04:56 +00:00
Szilárd Dóró
8726458df9 Merge pull request #572 from nhost/chore/auth-test-coverage
chore: Auth test coverage
2022-05-19 12:04:04 +02:00
Pierre-Louis Mercereau
c317669152 Merge branch 'main' into feat/vue 2022-05-19 12:04:04 +02:00
Pierre-Louis Mercereau
7d53883697 docs: simplify quickstart 2022-05-19 12:01:32 +02:00
Grégory D'Angelo
94105194ff Add extra line to avoid confusion 2022-05-19 11:40:29 +02:00
Grégory D'Angelo
433ceb508e Update JSX of the homepage 2022-05-19 11:38:59 +02:00
Grégory D'Angelo
dec2a83d0b Replace images src for logo with a public URL 2022-05-19 11:35:52 +02:00
Johan Eliasson
e4751470b0 typo 2022-05-19 11:03:26 +02:00
Szilárd Dóró
6c4233948d added patch notes 2022-05-19 10:49:44 +02:00
Johan Eliasson
5300c09f56 link fix 2022-05-19 10:48:35 +02:00
Johan Eliasson
5c13953a2b removed Get Started menu and made the platform the main entrypoint for our docs 2022-05-19 10:36:27 +02:00
Szilárd Dóró
160ebd9f04 Merge pull request #562 from nhost/changeset-release/main
chore: update versions
2022-05-19 10:22:16 +02:00
Szilárd Dóró
c16f630a7b Added refreshIntervalTime related tests 2022-05-19 10:05:03 +02:00
Johan Eliasson
688471faf0 Merge pull request #571 from nhost/fix/docs-typo
fix: Typo in docs
2022-05-19 09:27:52 +02:00
Pierre-Louis Mercereau
c42ffe6809 Merge branch 'main' into feat/vue 2022-05-19 09:19:59 +02:00
github-actions[bot]
f07d17a3e8 chore: update versions 2022-05-19 06:49:42 +00:00
Pilou
609681e741 Merge pull request #566 from nhost/fix/redirect-query-parameters
accept query parameters from both relative `redirectTo` URLs and the client URL
2022-05-19 08:48:44 +02:00
Szilárd Dóró
ab8d20a354 fix: Typo in docs 2022-05-19 08:24:01 +02:00
Pierre-Louis Mercereau
80c1de6a55 refactor: remove DEANONYMYZE event 2022-05-18 21:46:46 +02:00
Pierre-Louis Mercereau
52de584034 refactor: adjust 2022-05-18 21:39:31 +02:00
Johan Eliasson
543c85c85e Merge pull request #570 from nhost/docs-serverless-functions-underscore
docs: added information about prepending underscore
2022-05-18 21:30:43 +02:00
Johan Eliasson
4a9fbd6d84 using the word underscore 2022-05-18 21:29:40 +02:00
Johan Eliasson
24d45a1aed rephrase 2022-05-18 21:28:15 +02:00
Pierre-Louis Mercereau
edfb04cd07 refactor: improve naming consistency 2022-05-18 21:27:47 +02:00
Johan Eliasson
4511b7b538 added information about prepending underscore 2022-05-18 21:25:00 +02:00
Johan Eliasson
cb39f3d9ab Merge pull request #564 from nhost/docs-yu8g79yjo
Docs: CLI
2022-05-18 21:21:29 +02:00
Johan Eliasson
d49beb72bc typo 2022-05-18 21:14:19 +02:00
Johan Eliasson
d5ca9ae2c5 commands in sidebar 2022-05-18 21:09:53 +02:00
Pierre-Louis Mercereau
bb30d683ee Merge branch 'feat/vue' into anonymous-users 2022-05-18 20:57:14 +02:00
Pierre-Louis Mercereau
eb13606762 docs: "Vue 3" to "Vue" 2022-05-18 20:13:36 +02:00
Pierre-Louis Mercereau
3b16cfd295 feat: deanonymisation
tests need to be written
2022-05-18 20:11:18 +02:00
Grégory D'Angelo
d0201c8a23 Create new quickstarts guide for RedwoodJS 2022-05-18 19:59:57 +02:00
Johan Eliasson
80eeea49be moved storage and serverless functions to it's own files only instead of in directory 2022-05-18 17:54:29 +02:00
Johan Eliasson
e92716097e added list and upgrade 2022-05-18 17:44:03 +02:00
Johan Eliasson
54e11430b9 use up and down instad of dev and purge for docs 2022-05-18 17:42:48 +02:00
Johan Eliasson
7af47ba7d2 update 2022-05-18 17:41:27 +02:00
Johan Eliasson
7b624eae1c Updated CLI reference docs 2022-05-18 17:39:01 +02:00
Pierre-Louis Mercereau
151871cedc refactor: unnest if statement 2022-05-18 16:38:20 +02:00
Szilárd Dóró
4ecde10b99 Simplified time based token refresh tests
Also removed unnecessary error checks from auth machine
2022-05-18 15:49:26 +02:00
Szilárd Dóró
0530bac1f1 Token auto-refresh tests
- Added token auto-refresh related tests
- Simplified test context initialization
2022-05-18 15:02:02 +02:00
Pierre-Louis Mercereau
13e4fa73d5 typo 2022-05-18 12:21:13 +02:00
Pierre-Louis Mercereau
b1c652b550 Merge branch 'main' into feat/vue 2022-05-18 12:16:53 +02:00
Pierre-Louis Mercereau
5f980cb810 refactor: adjustments 2022-05-18 11:55:48 +02:00
Pierre-Louis Mercereau
0b58894ef1 fix: accept query parameters from both relative redirectTo URLs and the client URL 2022-05-18 11:27:22 +02:00
Johan Eliasson
3ba123dbff updated platform CLI docs 2022-05-18 10:44:15 +02:00
Johan Eliasson
0ffdeab89f updated docusaurus packages 2022-05-18 09:33:10 +02:00
Szilárd Dóró
df02e25d02 Merge pull request #561 from nhost/chore/auth-tests
chore: Authentication related tests
2022-05-17 20:18:34 +02:00
Szilárd Dóró
c7a407f111 added changesets 2022-05-17 15:53:43 +02:00
Szilárd Dóró
91edc67a5e Added password change related tests 2022-05-17 15:44:21 +02:00
Szilárd Dóró
d1a7bd7f94 Added email change tests 2022-05-17 15:31:47 +02:00
Pierre-Louis Mercereau
62c8c7a27f docs: use the same directory name 2022-05-17 15:15:08 +02:00
Pierre-Louis Mercereau
7c8f092667 chore: changesets 2022-05-17 15:01:41 +02:00
Pierre-Louis Mercereau
eb36f6698d Merge branch 'main' into feat/vue 2022-05-17 14:41:18 +02:00
Johan Eliasson
31b0830b91 Merge pull request #558 from nhost/sdk-docs-uygsa9h8dio
Docs: Updated inline and SDK docs
2022-05-17 14:36:19 +02:00
Szilárd Dóró
7c39b14fd2 Added MFA generation / activation tests 2022-05-17 14:19:24 +02:00
Johan Eliasson
16669d98e4 edit links correct for storage 2022-05-17 13:21:51 +02:00
Johan Eliasson
0696c108eb typo 2022-05-17 13:18:12 +02:00
Johan Eliasson
88f8e5dbed small updates 2022-05-17 13:17:08 +02:00
Pierre-Louis Mercereau
78ae8b52d0 docs: minor changes 2022-05-17 13:03:58 +02:00
Pilou
5a288f52df Merge pull request #560 from nhost/contributors-readme-action-Zl7cUfYzsW
contributors readme action update
2022-05-17 12:51:36 +02:00
github-actions[bot]
f922c02c08 contrib-readme-action has updated readme 2022-05-17 10:48:49 +00:00
Pilou
1abb4354e8 Merge pull request #549 from gaurav1999/patch-1
user-management: Specify metadata info
2022-05-17 12:48:35 +02:00
Pierre-Louis Mercereau
828bf5bf2d docs: adapt examples to composable ref values 2022-05-17 12:44:46 +02:00
Pierre-Louis Mercereau
d49d7d1ce0 feat: add missing composables 2022-05-17 12:32:54 +02:00
Johan Eliasson
b3f68b8748 more docs update 2022-05-17 12:11:28 +02:00
Pierre-Louis Mercereau
d51389b50d docs: remove todo code from the doc 2022-05-17 12:11:22 +02:00
Pierre-Louis Mercereau
8030f91f51 Merge branch 'feat/vue' of https://github.com/nhost/nhost into feat/vue 2022-05-17 12:07:15 +02:00
Pierre-Louis Mercereau
9a2afe7d77 Merge branch 'sdk-docs-uygsa9h8dio' into feat/vue 2022-05-17 12:06:03 +02:00
Pierre-Louis Mercereau
3e9cf30c40 Merge branch 'sdk-docs-uygsa9h8dio' into feat/vue 2022-05-17 12:04:54 +02:00
Johan Eliasson
0ee2171754 single user 2022-05-17 11:48:04 +02:00
Pierre-Louis Mercereau
f18b58e2fc Merge branch 'sdk-docs-uygsa9h8dio' into feat/vue 2022-05-17 11:40:08 +02:00
Pierre-Louis Mercereau
fa577f5c48 docs: correct links 2022-05-17 11:39:53 +02:00
Pierre-Louis Mercereau
8969748d3c docs: general vue documentation 2022-05-17 11:33:43 +02:00
Johan Eliasson
a112a9a8ad link fixed 2022-05-17 11:21:23 +02:00
Pierre-Louis Mercereau
589d17968f docs: copy vue composables documentation from react hooks 2022-05-17 11:03:41 +02:00
Szilárd Dóró
195b8ee4b7 Added email verification related tests
- improved the way validations are tested
- added email validation guard to reset password machine
2022-05-17 10:53:19 +02:00
Pierre-Louis Mercereau
44d092a997 Merge branch 'sdk-docs-uygsa9h8dio' into feat/vue 2022-05-17 10:50:06 +02:00
Johan Eliasson
21a9da792f storage inline docs updated 2022-05-17 10:37:34 +02:00
Pierre-Louis Mercereau
d8983be968 feat: allow nested ref options 2022-05-17 10:37:28 +02:00
Johan Eliasson
fd562b9c78 updated auth sdk docs 2022-05-17 10:20:01 +02:00
Szilárd Dóró
eca4ed92c1 Added password reset related tests 2022-05-17 10:17:48 +02:00
Szilárd Dóró
adf4d2b997 vitest bump, remaining token related tests 2022-05-17 09:52:12 +02:00
Johan Eliasson
3a724f847d Merge branch 'main' into sdk-docs-uygsa9h8dio 2022-05-17 09:47:42 +02:00
Johan Eliasson
99f941b060 next and react cleanup 2022-05-17 09:45:35 +02:00
Johan Eliasson
97392e547f all react hooks done first draft 2022-05-17 09:11:15 +02:00
Johan Eliasson
685e2dfccc react inline docs 2022-05-16 22:54:31 +02:00
Pierre-Louis Mercereau
1f8dd6dbd0 docs: use markup instead of html for Vue in prism 2022-05-16 22:25:27 +02:00
Pierre-Louis Mercereau
9b9d5def10 language 2022-05-16 22:23:07 +02:00
Pierre-Louis Mercereau
b4c08c999c docs: update tentative gh url 2022-05-16 22:21:19 +02:00
Pierre-Louis Mercereau
79425ad8e6 chore: don't export interface to avoid failed docgen link in docusaurus 2022-05-16 22:07:04 +02:00
Pierre-Louis Mercereau
a2a6790ae4 chore: lockfile, again 2022-05-16 21:44:07 +02:00
Pierre-Louis Mercereau
2ce1579ad6 docs: complete vue quickstart 2022-05-16 21:41:47 +02:00
Szilárd Dóró
0222d0fa22 improved refresh token related tests 2022-05-16 17:21:04 +02:00
Johan Eliasson
08e7a8e23a link fixed 2022-05-16 16:19:35 +02:00
Johan Eliasson
24faf32abe react docs update 2022-05-16 16:11:16 +02:00
Szilárd Dóró
8662674abe auto sign-in tests, improved in-memory storage 2022-05-16 16:05:55 +02:00
Pierre-Louis Mercereau
a53d57a0e3 build: update lockfile 2022-05-16 14:26:23 +02:00
Pierre-Louis Mercereau
61df286fe8 build: add missing changes 2022-05-16 14:21:45 +02:00
Pierre-Louis Mercereau
0dce5d47f0 build: correct vue-quickstart 2022-05-16 14:18:37 +02:00
Johan Eliasson
e9a01588da JavaScript index update 2022-05-16 14:15:59 +02:00
Johan Eliasson
17e370e889 update 2022-05-16 14:00:25 +02:00
Johan Eliasson
5929da369f more inline docs 2022-05-16 13:59:22 +02:00
Pierre-Louis Mercereau
23dd5e9414 ci: exec build, test and lint in series 2022-05-16 13:58:56 +02:00
Pierre-Louis Mercereau
32346f4e5a refactor: correct vue test scripts 2022-05-16 13:46:54 +02:00
Johan Eliasson
d4450ea0e4 added nhost.auth 2022-05-16 13:44:37 +02:00
Johan Eliasson
f5b86f5865 storage inline docs updated 2022-05-16 13:43:59 +02:00
Pierre-Louis Mercereau
69b3a6ba93 Merge branch 'main' into feat/vue 2022-05-16 13:40:36 +02:00
Szilárd Dóró
a6cfdb67d0 Merge pull request #557 from nhost/testing-framework
Testing framework
2022-05-16 13:23:34 +02:00
Johan Eliasson
645eaf6367 updated hasura auth js docs 2022-05-16 13:22:53 +02:00
Pierre-Louis Mercereau
02aee323a2 refactor: simplify machine and adjust tests 2022-05-16 13:20:24 +02:00
Szilárd Dóró
5217ffa5e3 renamed test files, removed unnecessary states 2022-05-16 12:36:42 +02:00
Szilárd Dóró
b08790b7ab removed "sleep" calls from sign out tests 2022-05-16 11:48:24 +02:00
Pierre-Louis Mercereau
9737fde711 Merge branch 'testing-framework' into feat/vue 2022-05-16 11:39:31 +02:00
Szilárd Dóró
5802feedec code format improvements, fixed sign out tests 2022-05-16 11:23:16 +02:00
Pierre-Louis Mercereau
63f607b8f1 Merge branch 'main' into feat/vue 2022-05-16 09:35:52 +02:00
Pierre-Louis Mercereau
c5ed2e0793 docs: common create-nhost-app fragment 2022-05-16 09:35:41 +02:00
Johan Eliasson
79f153e627 Merge pull request #556 from nhost/functions-f657g8hui
docs: Serverless functions
2022-05-16 09:22:31 +02:00
Johan Eliasson
84c5ae1cba update 2022-05-16 09:22:20 +02:00
Johan Eliasson
b5f82d9dd0 Merge pull request #554 from nhost/nunopato-patch-1
Remove outdated mention to minio.
2022-05-16 09:13:07 +02:00
Johan Eliasson
00e03d44b5 more info 2022-05-16 09:08:11 +02:00
Johan Eliasson
15aacc09db production info 2022-05-16 09:04:26 +02:00
Johan Eliasson
01b53348c4 updates 2022-05-16 08:54:59 +02:00
Johan Eliasson
aa770cc15a serverless functions 2022-05-16 08:32:51 +02:00
Nuno Pato
552790fe3f Remove outdated mention to minio. 2022-05-13 17:24:12 +02:00
Pierre-Louis Mercereau
6f12144615 docs: vue quickstart: wip 2022-05-13 15:51:59 +02:00
Szilárd Dóró
4d08a2c1dd Merge pull request #552 from nhost/contributors-readme-action-VJJueJLfwd
contributors readme action update
2022-05-13 15:05:36 +02:00
github-actions[bot]
ee34b9d2aa contrib-readme-action has updated readme 2022-05-13 12:29:06 +00:00
Johan Eliasson
0d87c30a8e Merge pull request #517 from nhost/docs-guides
Docs guides
2022-05-13 14:28:50 +02:00
Johan Eliasson
d7aaeeb8cc syncing package manager tabs 2022-05-13 14:20:28 +02:00
Johan Eliasson
101f4f502d v12 latest 2022-05-13 14:17:15 +02:00
Johan Eliasson
d070680abd settings only work locally for now 2022-05-13 14:16:17 +02:00
Szilárd Dóró
aa16ba979b Sign out related tests
- added sign out related tests
- still need to figure out token removal from storage
2022-05-13 14:02:42 +02:00
Szilárd Dóró
3f07c33b17 improved Sign In test structure in Core package 2022-05-13 10:49:37 +02:00
Szilárd Dóró
f935269a6b improved Sign In tests, created Sign Up tests 2022-05-13 09:55:59 +02:00
Pierre-Louis Mercereau
5f9b2f5b27 Merge remote-tracking branch 'origin/docs-guides' into feat/vue 2022-05-13 09:30:41 +02:00
Szilárd Dóró
965f1b26b0 Merge branch 'main' into testing-framework 2022-05-12 16:44:22 +02:00
Szilárd Dóró
08394ffd01 Sign up test stubs, Sign in test wording updates 2022-05-12 16:28:23 +02:00
Szilárd Dóró
802d095044 added remaining password sign in tests 2022-05-12 16:09:53 +02:00
Szilárd Dóró
9340e115d1 final MFA TOTP tests 2022-05-12 14:58:25 +02:00
Szilárd Dóró
170dbfc930 MFA ticket validation, MFA TOTP tests 2022-05-12 14:43:05 +02:00
Pierre-Louis Mercereau
a525409bee refactor: use a consistent syntax to send events to state machines 2022-05-12 12:45:07 +02:00
Pierre-Louis Mercereau
5f718bf356 refactor: improve code sharing 2022-05-12 12:32:28 +02:00
Szilárd Dóró
e44c4b2e93 Passwordless SMS OTP tests 2022-05-12 11:32:59 +02:00
Szilárd Dóró
5154d31126 Passwordless SMS tests, MSW folder structure 2022-05-12 10:32:11 +02:00
Pierre-Louis Mercereau
913aef1986 chore: lint 2022-05-12 09:45:48 +02:00
Pierre-Louis Mercereau
ce93615c1c Merge remote-tracking branch 'origin/main' into feat/vue 2022-05-12 09:44:05 +02:00
Johan Eliasson
f5e542e4c1 updated template link 2022-05-12 09:21:47 +02:00
Johan Eliasson
029925d88f added graphql dependency 2022-05-12 08:12:52 +02:00
Gaurav Agrawal
718a4db33c user-management: Specify metadata info
fixes #241
2022-05-11 21:16:35 +05:30
Szilárd Dóró
5a7be0cfd4 Passwordless email tests, hasura-auth-js CI fix 2022-05-11 16:18:32 +02:00
Johan Eliasson
f4dc867242 updated CTA 2022-05-11 15:58:19 +02:00
Johan Eliasson
038e279660 typo 2022-05-11 15:05:22 +02:00
Johan Eliasson
f671a5a420 small updates 2022-05-11 15:03:59 +02:00
Johan Eliasson
95dbfd59ee Merge pull request #535 from gdangelo/patch-5
docs: Update Next.js quickstart guide
2022-05-11 14:30:33 +02:00
Johan Eliasson
8980c99200 Merge pull request #536 from gdangelo/patch-6
docs: Update React quickstart guide
2022-05-11 14:20:35 +02:00
Szilárd Dóró
c0dcdb2410 started working on passwordless sign in tests 2022-05-11 14:20:07 +02:00
Pilou
1035639850 Merge pull request #544 from nhost/changeset-release/main
chore: update versions
2022-05-11 13:33:54 +02:00
Szilárd Dóró
9be836b036 Merge branch 'main' into testing-framework 2022-05-11 13:15:45 +02:00
github-actions[bot]
0e96e7329e chore: update versions 2022-05-11 11:13:25 +00:00
Szilárd Dóró
19ccc5ab0d Merge pull request #548 from nhost/axios-version-bump
Bump `axios` and set correct `Content-Type` for file upload
2022-05-11 13:12:16 +02:00
Szilárd Dóró
e094e682ce bump axios and fix file upload Content-Type
chore: bump axios from 0.26.0 to 0.27.2
fix: add Content-Type to file upload request headers
2022-05-11 12:45:52 +02:00
Szilárd Dóró
49cc3cb41b added test case for network errors when signing in 2022-05-11 10:23:16 +02:00
Szilárd Dóró
e0d81d419f fix: idempotent test results if the order of tests changes 2022-05-11 09:21:59 +02:00
Pilou
74eb71f8f0 Merge pull request #543 from nhost/fix/signup-states
Fix/signup states
2022-05-11 08:59:41 +02:00
Pierre-Louis Mercereau
a931c15073 Merge main and fix wrong negation 2022-05-11 08:30:40 +02:00
Pierre-Louis Mercereau
d3028169df docs: add apollo to the vue example 2022-05-10 23:20:10 +02:00
Szilárd Dóró
e04d88b034 chore: improved test helper structure 2022-05-10 18:56:22 +02:00
Szilárd Dóró
eca552b931 merged email and password error test cases 2022-05-10 17:30:33 +02:00
Szilárd Dóró
ed30bdd7e1 chore: improved structure of helpers 2022-05-10 17:26:49 +02:00
Szilárd Dóró
b76bc30fe4 Merge pull request #546 from nhost/testing-framework-patch
refactor: reset errors when entering auth states instead of doing it when exiting the signOut state
2022-05-10 16:54:00 +02:00
Pierre-Louis Mercereau
2b571ebf23 refactor: reset errors when entering auth states instead of doing it when exiting the signOut state 2022-05-10 16:41:45 +02:00
Pierre-Louis Mercereau
ce2a77a859 test: check auth actions are run in the right state 2022-05-10 15:11:11 +02:00
Pierre-Louis Mercereau
5bb64ae36b fix: start interpreters 2022-05-10 14:34:43 +02:00
Pierre-Louis Mercereau
79258689ef refactor: continue reusing common auth actions, and update doc links 2022-05-10 14:17:17 +02:00
Pierre-Louis Mercereau
8a1eefeee6 refactor: use the same actions in hasura-auth-js, react hooks and vue composables 2022-05-10 13:58:33 +02:00
Szilárd Dóró
ebe9fb0a44 started working on Sign In flow related tests 2022-05-10 13:49:37 +02:00
Pierre-Louis Mercereau
25f0d05fc2 refactor: improve code consistency 2022-05-10 13:20:44 +02:00
Pierre-Louis Mercereau
ace5d89eed refactor: adapt hooks to Vue while using shared logic 2022-05-10 12:45:53 +02:00
Pierre-Louis Mercereau
92cf6ae7bd Merge remote-tracking branch 'origin/main' into feat/vue 2022-05-10 10:53:55 +02:00
Pilou
9ae5e485e6 Merge pull request #520 from nhost/feat/improve-errors
Improve the handling of authentication errors
2022-05-10 10:39:57 +02:00
Pierre-Louis Mercereau
2965a7bf5b chore: update lockfile 2022-05-10 10:12:52 +02:00
Pierre-Louis Mercereau
236ce72bb3 fix: correct email verification states and useSignUpEmailPassword loading state 2022-05-10 10:12:03 +02:00
Pierre-Louis Mercereau
5ad5832e41 docs: minor improvements in the examples 2022-05-10 10:08:54 +02:00
Szilárd Dóró
a57825e5ad Merge branch 'main' into testing-framework 2022-05-10 09:45:20 +02:00
Pierre-Louis Mercereau
648eac45b4 chore: configure eslint for either react or vue 2022-05-09 22:17:47 +02:00
Pierre-Louis Mercereau
47936d4d1a Merge remote-tracking branch 'origin/main' into feat/vue 2022-05-09 21:49:56 +02:00
Pilou
1e233b6582 Merge pull request #541 from nhost/changeset-release/main
chore: update versions
2022-05-09 21:47:15 +02:00
github-actions[bot]
9ebd014287 chore: update versions 2022-05-09 19:32:16 +00:00
Pilou
6ce2534a36 Merge pull request #540 from nhost/dont-ignore-changeset
ci: trigger GH action even if comitted files are only in the `.changeset` directory
2022-05-09 21:31:23 +02:00
Pierre-Louis Mercereau
9f8e792f0d ci: trigger GH action even if comitted files are only in the .changeset directory 2022-05-09 21:29:29 +02:00
Pierre-Louis Mercereau
e1383106d9 Merge remote-tracking branch 'origin/main' into feat/improve-errors 2022-05-09 21:16:33 +02:00
Szilárd Dóró
812d7a8eae Merge pull request #539 from nhost/chore/nhost-react-changesets
chore: @nhost/react release notes
2022-05-09 21:10:53 +02:00
Szilárd Dóró
2887ce0f82 @nhost/react release notes 2022-05-09 21:08:18 +02:00
Szilárd Dóró
8bdfb8fcac Merge pull request #538 from nhost/fix/xstate-react-version
fix: @xstate/react bump to support React 18
2022-05-09 21:00:54 +02:00
Szilárd Dóró
573436dd87 fix: @xstate/react version to support React 18 2022-05-09 20:48:47 +02:00
Pierre-Louis Mercereau
1c82ab5346 refactor: basic vue eslint 2022-05-09 20:27:58 +02:00
Grégory D'Angelo
c7ce66597a docs: Update React quickstart guide
Update the guide based on Johan's feedback + add a new section at the end to show how to use the GraphQL API to fetch user data + reflect changes from the provided template.
2022-05-09 19:16:08 +02:00
Grégory D'Angelo
c82605c4e8 docs: Update Next.js quickstart guide 2022-05-09 19:12:41 +02:00
Pierre-Louis Mercereau
479cbbe305 refactor: use common promises in vue and react 2022-05-09 17:36:51 +02:00
Pierre-Louis Mercereau
888a51ed33 refactor: adapt to new monorepo setup 2022-05-09 16:37:47 +02:00
Szilárd Dóró
ef41ce8bb2 merged Vite configs, watch mode 2022-05-09 15:15:17 +02:00
Szilárd Dóró
864074fba5 added support for vitest
- Upgraded tests to use utilities of vitest
2022-05-09 14:52:32 +02:00
Szilárd Dóró
f58c2bb9ce Merge pull request #530 from nhost/changeset-release/main
chore: update versions
2022-05-09 14:10:10 +02:00
Pierre-Louis Mercereau
4eac3101c9 refactor: deprecated the use of isError when it is the negation of isSuccess 2022-05-09 13:01:54 +02:00
Pierre-Louis Mercereau
80bd938336 Merge remote-tracking branch 'origin/main' into feat/improve-errors 2022-05-09 10:50:43 +02:00
Pilou
41db6f613a Merge pull request #532 from nhost/contributors-readme-action-dGXEs_q2EP
contributors readme action update
2022-05-09 10:44:31 +02:00
github-actions[bot]
ee84bfa098 chore: update versions 2022-05-09 08:43:56 +00:00
github-actions[bot]
ad1b7b80e2 contrib-readme-action has updated readme 2022-05-09 08:42:51 +00:00
Pilou
3fcd345cff Merge pull request #528 from nhost/nextjs-example-email-sent-model
nextjs example: add an "email sent" modal to the magic-link page
2022-05-09 10:42:37 +02:00
Pierre-Louis Mercereau
43a3f1dd46 Merge remote-tracking branch 'origin/main' into nextjs-example-email-sent-model 2022-05-09 10:36:36 +02:00
Pilou
3ec745c91e Merge pull request #514 from MarcelloTheArcane/patch-1
Fix signIn/signUp typo
2022-05-09 10:34:09 +02:00
Pierre-Louis Mercereau
92deec4531 docs: docgen 2022-05-09 10:28:26 +02:00
Pierre-Louis Mercereau
c7fcc9fe82 Merge remote-tracking branch 'origin/main' into patch-1 2022-05-09 10:27:22 +02:00
Pilou
081377af6c Merge pull request #531 from nhost/clean-nextjs-example
refactor: stop using next-transpile-modules
2022-05-09 10:25:11 +02:00
Pierre-Louis Mercereau
23cb207afc style: typo 2022-05-09 10:23:59 +02:00
Johan Eliasson
62b1495a22 docs update 2022-05-09 10:13:16 +02:00
Pierre-Louis Mercereau
8a79a7102f Merge remote-tracking branch 'origin/main' into feat/improve-errors 2022-05-09 10:11:40 +02:00
Pierre-Louis Mercereau
0f55f6db9b style: post feedback 2022-05-09 10:07:04 +02:00
Pierre-Louis Mercereau
7b16a8d790 Merge remote-tracking branch 'origin/main' into nextjs-example-email-sent-model 2022-05-09 10:05:00 +02:00
Pierre-Louis Mercereau
dca8233601 refactor: stop using next-transpile-modules
It is not required in the new monorepo setup
2022-05-09 10:03:27 +02:00
Pilou
a7535b260b Merge pull request #529 from nhost/contributors-readme-action-xXIDbIv_3L
contributors readme action update
2022-05-09 09:56:40 +02:00
github-actions[bot]
82520963f1 contrib-readme-action has updated readme 2022-05-09 07:48:43 +00:00
Szilárd Dóró
722abd9a19 Merge pull request #462 from nhost/monorepo-improvements
Monorepo improvements
2022-05-09 09:48:28 +02:00
Pierre-Louis Mercereau
92fbf2b425 merge main 2022-05-09 09:38:00 +02:00
Szilárd Dóró
2aff6c0b4e fix: lock file changes 2022-05-09 09:12:03 +02:00
Szilárd Dóró
e101915f60 Merge branch 'main' into monorepo-improvements 2022-05-09 09:09:35 +02:00
Pierre-Louis Mercereau
0195143fe1 fix: correct the way to monitor the email is awaiting verification 2022-05-08 19:08:53 +02:00
Pierre-Louis Mercereau
e362925041 feat: pull needsEmailVerification out of the signedIn state 2022-05-07 21:19:26 +02:00
Pierre-Louis Mercereau
b4f8c7457d docs: remove option that raises a React warning 2022-05-07 16:39:59 +02:00
Pierre-Louis Mercereau
84f1ab2f61 docs: add an "email sent" modal to the magic-link page 2022-05-07 16:35:41 +02:00
Pilou
dee93bb873 Merge pull request #526 from nhost/changeset-release/main
chore: update versions
2022-05-06 22:29:55 +02:00
github-actions[bot]
173b587802 chore: update versions 2022-05-06 20:24:16 +00:00
Pilou
30ef1660b4 Merge pull request #525 from nhost/fix/cookie-mode
fix: correct cookie storage type
2022-05-06 22:23:12 +02:00
Pierre-Louis Mercereau
a613aa9f0c refactor: unnest if block 2022-05-06 22:12:50 +02:00
Pierre-Louis Mercereau
3c03b9b46f refactor: remove dead code 2022-05-06 22:09:51 +02:00
Pierre-Louis Mercereau
65a3061146 fix: correct cookie storage type 2022-05-06 22:01:38 +02:00
Johan Eliasson
f4c2088bce grammarly updates 2022-05-06 20:13:57 +02:00
Johan Eliasson
d3107934b0 updates 2022-05-06 20:11:23 +02:00
Johan Eliasson
5ae02605b2 added npm/yarn tabs 2022-05-06 20:08:39 +02:00
Pilou
55864eac30 Merge pull request #522 from nhost/event-triggers-syntax-error
fixed syntax error in Event Triggers docs
2022-05-06 19:59:46 +02:00
Johan Eliasson
b927587d75 correct repo link 2022-05-06 19:34:21 +02:00
Johan Eliasson
e63c45cdaa grammarly updates 2022-05-06 19:29:45 +02:00
Szilárd Dóró
28494d6c1f fixed syntax error in Event Triggers docs 2022-05-06 19:09:51 +02:00
Pilou
6777738c53 Merge pull request #519 from nhost/changeset-release/main
chore: update versions
2022-05-06 15:24:04 +02:00
Szilárd Dóró
34532b1a2f Merge branch 'main' into monorepo-improvements 2022-05-06 14:53:03 +02:00
Pierre-Louis Mercereau
de3257ca7a Merge branch 'main' into feat/improve-errors 2022-05-06 14:46:14 +02:00
Pierre-Louis Mercereau
9d32314065 feat: improve the handling of authentication errors 2022-05-06 14:44:54 +02:00
Johan Eliasson
9edfe408e0 updated template repo 2022-05-06 14:17:33 +02:00
github-actions[bot]
0d60693c27 chore: update versions 2022-05-06 11:43:21 +00:00
Pilou
c159c9c98c Merge pull request #518 from nhost/fix/refresh-token-load
fix: corrections and reshape the react-apollo example
2022-05-06 13:42:05 +02:00
Pierre-Louis Mercereau
58fa2a201c fix: corrections and reshape the react-apollo example 2022-05-06 12:55:17 +02:00
Johan Eliasson
d3c7930b48 all images locally 2022-05-06 12:22:45 +02:00
Johan Eliasson
4a864a9777 store quickstart images locally 2022-05-06 12:12:32 +02:00
Johan Eliasson
50ba5fe2c8 Merge pull request #494 from gdangelo/patch-4
Add content for the React quickstart guide
2022-05-06 11:53:01 +02:00
Johan Eliasson
05e0c42c82 Merge pull request #484 from gdangelo/patch-2
Create "Get started with Nhost CLI" guide
2022-05-06 11:52:49 +02:00
Johan Eliasson
fbc9ff32dd Merge pull request #485 from gdangelo/patch-3
Add content for the Next.js quickstart guide
2022-05-06 11:52:13 +02:00
Johan Eliasson
db4607ccac Merge pull request #516 from nhost/docs-guides
Docs intro of Nhost
2022-05-06 11:50:05 +02:00
Johan Eliasson
95b14557a0 intro 2022-05-06 11:47:29 +02:00
Johan Eliasson
8b527d0fcb Merge pull request #445 from nhost/docs-guides
docs: intro, architecture and quickstarts
2022-05-06 11:43:41 +02:00
Szilárd Dóró
67f0450dac fixed issues with package references in Next.js docs 2022-05-06 11:01:53 +02:00
Pilou
fc50beec5e Merge pull request #513 from nhost/docs/clean-nextjs-intro
remove reference to useless component
2022-05-06 10:42:24 +02:00
Szilárd Dóró
584976d1ad added patch notes 2022-05-06 10:32:13 +02:00
Szilárd Dóró
509ed7d864 Merge branch 'main' into monorepo-improvements 2022-05-06 08:56:34 +02:00
Max Reynolds
71b92363b4 Fix signIn/signUp typo
I think the example should be for signUp here.
2022-05-06 06:25:20 +01:00
Pierre-Louis Mercereau
ed0de2d930 remove reference to useless component 2022-05-05 21:53:37 +02:00
Grégory D'Angelo
c7aa9f7ea9 Edit code snippets to replace Tailwind utility classes with CSS modules
As discussed with Johan. The React template for this guide has also been edited to remove Tailwind CSS and use CSS modules instead.

You can find this template here: https://github.com/gdangelo/cra-template-quickstart-nhost. Please make sure to move it to the Nhost Github repository and publish it to npm.
2022-05-05 19:50:09 +02:00
Grégory D'Angelo
3e6057b4ed Edit code snippets to replace Tailwind utility classes with CSS modules
As discussed with Johan. The Next.js template for this guide has also been edited to remove Tailwind CSS and use CSS modules instead.

You can find this template here: https://github.com/gdangelo/nhost-quickstart-nextjs. Please make sure to move it to the Nhost Github repository.
2022-05-05 19:11:49 +02:00
Pierre-Louis Mercereau
e2940d7de3 merge 2022-05-05 16:52:40 +02:00
Pierre-Louis Mercereau
c65c7f5538 chore: correct typings 2022-05-05 16:36:13 +02:00
Pilou
f26e8c3614 Merge pull request #491 from nhost/changeset-release/main
chore: update versions
2022-05-05 16:11:42 +02:00
Pierre-Louis Mercereau
a05a484426 chore: correct changelog 2022-05-05 16:04:33 +02:00
Pierre-Louis Mercereau
4f0d5aa9c0 chore: downgrade major to minor bump 2022-05-05 16:02:23 +02:00
github-actions[bot]
254e362e95 chore: update versions 2022-05-05 13:58:01 +00:00
Pilou
a2a8839694 Merge pull request #507 from nhost/refactor/simplify-and-correct-options
Make code more consistent, implement the 'custom and 'cookie' storage types
2022-05-05 15:56:41 +02:00
Pierre-Louis Mercereau
d12667ccc5 refactor: post-review 2022-05-05 15:22:35 +02:00
Pierre-Louis Mercereau
feb55fe0ad chore: update lockfile 2022-05-05 14:43:12 +02:00
Pilou
b97c0a9c9d Merge branch 'main' into refactor/simplify-and-correct-options 2022-05-05 14:35:08 +02:00
Szilárd Dóró
bb548cd108 added support for TS package references, fixed CI 2022-05-05 14:15:20 +02:00
Szilárd Dóró
adb30c537f updated pnpm-lock.yaml file 2022-05-05 13:53:54 +02:00
Szilárd Dóró
d7d3e8f903 Merge branch 'main' into monorepo-improvements 2022-05-05 13:53:09 +02:00
Pierre-Louis Mercereau
2e98934f75 refactor: expose the interface of NhostReactProvider and use PropsWithChildren type 2022-05-05 13:35:30 +02:00
Szilárd Dóró
8a4064e99f reverted next-transpile-modules change 2022-05-05 13:31:27 +02:00
Pilou
937e28116b Merge pull request #509 from nhost/monorepo-adjustments
Adjustments to the new monorepo setup
2022-05-05 13:27:57 +02:00
Pilou
8cedafc807 Merge pull request #503 from nhost/patch/react-18
Patch/react 18
2022-05-05 13:27:24 +02:00
Pierre-Louis Mercereau
d885fe7b02 refactor: remove direct dependency to @nhost/core 2022-05-05 12:50:55 +02:00
Pierre-Louis Mercereau
b0d7217276 refactor: correct react-apollo-crm tsconfig 2022-05-05 12:38:49 +02:00
Pierre-Louis Mercereau
bfba4ae7ec refactor: make the react examples work inside the monorepo 2022-05-05 12:37:30 +02:00
Pierre-Louis Mercereau
11934f202d refactor: use clearer syntax when sending xstate events 2022-05-05 12:18:11 +02:00
Pierre-Louis Mercereau
322b433994 docs(example): correct nextjs example 2022-05-05 12:07:20 +02:00
Pierre-Louis Mercereau
6082ba6943 docs: remove part of the doc already automatically generated 2022-05-05 10:54:24 +02:00
Szilárd Dóró
44b12dc0a0 updated DEVELOPERS.md: fixed some typos, added development mode related info 2022-05-05 10:46:43 +02:00
Pierre-Louis Mercereau
1fb1d25a72 chore: remove testing credentials 2022-05-05 10:39:07 +02:00
Pierre-Louis Mercereau
ae4e4e50f6 chore: update changeset 2022-05-05 10:37:22 +02:00
Pierre-Louis Mercereau
185f39e23f fix: don't take previous errors into account when using SMS and deanonymisation 2022-05-05 10:35:49 +02:00
Szilárd Dóró
bf6ee5d360 unified Prettier configuration, temporarily disabled import sorter 2022-05-05 10:28:11 +02:00
Pierre-Louis Mercereau
0dd7cab3bf fix: remove async import 2022-05-04 22:35:18 +02:00
Pierre-Louis Mercereau
47c7380d89 refactor: cooooooooookies
(miom miom miom)
2022-05-04 22:28:13 +02:00
Pierre-Louis Mercereau
b56162a74b refactor: make code more consistent, and implement the 'custom and 'cookie' client storage types 2022-05-04 22:25:17 +02:00
Grégory D'Angelo
1a7007d1cb Remove the CLI and Github connection steps
As discussed with Johan.
2022-05-04 17:58:29 +02:00
Grégory D'Angelo
05d25a54af Remove the CLI and Github connection steps
As discussed with Johan
2022-05-04 17:52:21 +02:00
Szilárd Dóró
9f8bdb504d fixed UMD config 2022-05-04 16:02:13 +02:00
Pierre-Louis Mercereau
aeb8b8afda chore: lint, and update changesets 2022-05-04 14:23:58 +02:00
Pierre-Louis Mercereau
f9e107b008 docs: return errors to the UI 2022-05-04 13:42:30 +02:00
Szilárd Dóró
cd2594f66a fixed linter configs 2022-05-04 13:33:03 +02:00
Szilárd Dóró
c6a3e9f516 restructured project configuration, removed config copy script 2022-05-04 13:15:07 +02:00
Pierre-Louis Mercereau
d748d82483 docs: flesh up the nextjs example 2022-05-04 13:11:00 +02:00
Szilárd Dóró
1bfb1e6d10 Merge branch 'main' into monorepo-improvements 2022-05-04 11:13:13 +02:00
Szilárd Dóró
35fd7b1b7c added root lintstagedrc to gitignore 2022-05-04 11:10:01 +02:00
Szilárd Dóró
04c1ed6955 moved lintstagedrc and tsconfig files to .config folder 2022-05-04 11:02:40 +02:00
Szilárd Dóró
0c591daef4 fixed source code references of docs 2022-05-04 10:54:29 +02:00
Johan Eliasson
2192fdc92e change cta 2022-05-04 09:04:53 +02:00
Johan Eliasson
eec2601a3a architecture 2022-05-04 08:55:17 +02:00
Johan Eliasson
93eaa85b47 Merge branch 'main' into docs-guides 2022-05-04 07:40:53 +02:00
Pierre-Louis Mercereau
4c8a168c02 refactor: update lockfile 2022-05-03 22:12:57 +02:00
Pierre-Louis Mercereau
eb166cf5ee refactor: remove debug code 2022-05-03 22:07:07 +02:00
Pierre-Louis Mercereau
54e1873461 refactor: wrap again the apollo client creation into useEffect to avoid SSR when CSR 2022-05-03 22:02:15 +02:00
Pierre-Louis Mercereau
e5bc3b356c refactor(nextjs): bump to React 18 and Apollo client 3.6.2 2022-05-03 21:43:39 +02:00
Pierre-Louis Mercereau
42edb74057 refactor: upgrade to React 18 2022-05-03 21:20:10 +02:00
Pierre-Louis Mercereau
3ebeae9294 refactor: upgrade react-apollo to React 18 to reproduce the missing attached headers bug 2022-05-03 19:51:50 +02:00
Pilou
24189bd155 Merge pull request #501 from nhost/contributors-readme-action-tjRSlp2hVR
contributors readme action update
2022-05-03 16:47:01 +02:00
github-actions[bot]
5985b18764 contrib-readme-action has updated readme 2022-05-03 14:43:47 +00:00
Pilou
95efcb4de6 Merge pull request #500 from heygambo/patch-1
Adds environment variables to auth service
2022-05-03 16:43:30 +02:00
Christian Gambardella
609d9001f5 Adds environment variables to auth service
I ran into an issue where I couldn't sign up users because the auth service wasn't able to connect to mailhog.
That caused the auth service to not send an email and not respond to the HTTP request.

fixes #499 

I'm wondering if anyone else had this issue. If I'm the only one then maybe this PR is obsolete.
2022-05-03 16:18:36 +02:00
Szilárd Dóró
6f5729eb45 fixed Next.js example configuration 2022-05-03 15:54:21 +02:00
Szilárd Dóró
9bc447dbff fixed pnpm-lock 2022-05-03 15:51:02 +02:00
Szilárd Dóró
d2d0e7fced reverted package versions to leverage pnpm workspace features 2022-05-03 15:48:59 +02:00
Szilárd Dóró
0ad654226b fixed example projects, upgraded Vite to latest version 2022-05-03 13:54:32 +02:00
Pierre-Louis Mercereau
14f0d27c7d refactor: improve auth machine, vue plugin and tokens in url 2022-05-03 13:01:32 +02:00
Szilárd Dóró
9d8f2dea22 UMD module name change for all packages 2022-05-03 11:16:33 +02:00
Szilárd Dóró
f3a44931a5 reverted unnecessary build command change 2022-05-03 08:35:51 +02:00
Pierre-Louis Mercereau
9933e4389e refactor: use vuetify instead of quasar, implement oauth composable, correct bugs, extend example 2022-05-02 17:29:24 +02:00
Pilou
1e44a14b8a Merge pull request #497 from nhost/docs/generate-hasura-auth-openapi
Generate the latest hasura-auth openapi specs
2022-05-02 17:05:26 +02:00
Szilárd Dóró
1c1656441b removed esbuild related packages from pnpm-lock 2022-05-02 17:00:42 +02:00
Szilárd Dóró
5f68f8fe31 fixed build warning caused by a missing global 2022-05-02 16:54:26 +02:00
Szilárd Dóró
961103d7a5 removed individual Vite configs, using unified 2022-05-02 16:27:48 +02:00
Szilárd Dóró
2bebab3f8e fixed ESLint ignore patterns to prevent lint error 2022-05-02 15:11:12 +02:00
Szilárd Dóró
0363abbbb1 fixed CI build and test step 2022-05-02 14:48:47 +02:00
Szilárd Dóró
2f3715d02a fixed linter errors 2022-05-02 14:05:26 +02:00
Szilárd Dóró
7c101e5226 removed unnecessary tsconfig, fixed an issue in NhostClient 2022-05-02 13:52:42 +02:00
Szilárd Dóró
ef943995e2 added umd folder to cached turborepo output 2022-05-02 13:30:56 +02:00
Szilárd Dóró
b6032508bc docs reference update, tsconfig fixes 2022-05-02 12:50:53 +02:00
Szilárd Dóró
a6b00294e7 Merge branch 'main' into monorepo-improvements 2022-05-02 12:17:52 +02:00
Szilárd Dóró
dbfc5ec220 added support for UMD build 2022-05-02 11:55:42 +02:00
Pierre-Louis Mercereau
5917eff5a6 chore: newline 2022-05-02 09:44:38 +02:00
Pierre-Louis Mercereau
f8ee87ad01 feat: smalls script that generates the latest hasura-auth openapi specs 2022-05-02 09:42:24 +02:00
Szilárd Dóró
a7990b363f Merge pull request #496 from nhost/contributors-readme-action-Vits42iSrd
contributors readme action update
2022-05-02 08:59:28 +02:00
github-actions[bot]
ca8ecb4b5c contrib-readme-action has updated readme 2022-05-02 06:48:04 +00:00
Szilárd Dóró
dfe080b8f6 Merge pull request #495 from GavanWilhite/patch-2
Fixed npm <> yarn instructions
2022-05-02 08:47:50 +02:00
Gavan Wilhite
069a5d4d9a Fixed npm <> yarn instructions 2022-05-01 19:42:53 -06:00
Grégory D'Angelo
c9d474ea6c Use .mdx extension instead 2022-04-29 18:30:02 +02:00
Grégory D'Angelo
2afa460263 Use .mdx extension instead 2022-04-29 18:29:35 +02:00
Grégory D'Angelo
776555bdda Add content for the React quickstart guide 2022-04-29 18:27:59 +02:00
Grégory D'Angelo
e0e9729884 Add missing props to NhostApolloProvider 2022-04-29 18:20:21 +02:00
Szilárd Dóró
6ffaf31af5 simplified tsconfig of React libs 2022-04-29 17:33:29 +02:00
Szilárd Dóró
8ec18157bb simplified Vite config of packages, improved TSConfig 2022-04-29 17:31:18 +02:00
Pilou
efccd54641 Merge pull request #492 from nhost/docs/autogen-edit-page
feat: link the 'Edit Page' button to the source code instead of the generated file
2022-04-29 17:02:18 +02:00
Grégory D'Angelo
396dc554d9 Remove sections number + add level 4 titles 2022-04-29 16:36:08 +02:00
Grégory D'Angelo
92f9576ca6 Re-organize sections 2022-04-29 16:16:49 +02:00
Grégory D'Angelo
5cf8ace1bc Add title to code snippets + fix syntax highlighting + add tabs + admonitions 2022-04-29 16:10:54 +02:00
Grégory D'Angelo
cf1518ab75 Use admonitions instead of basic Markdown quotes 2022-04-29 15:38:30 +02:00
Grégory D'Angelo
b8c0dba6de Update language for syntax highlighting to bash + add titles 2022-04-29 15:31:53 +02:00
Pierre-Louis Mercereau
116c8eba66 fix: close img tags 2022-04-29 14:52:13 +02:00
Pierre-Louis Mercereau
a9bc698dae fix: close img tags 2022-04-29 14:49:00 +02:00
Szilárd Dóró
175ab26e04 Merge branch 'main' into monorepo-improvements 2022-04-29 13:54:29 +02:00
Szilárd Dóró
eb2d064cbe restored removed docs pages 2022-04-29 13:38:53 +02:00
Szilárd Dóró
17d2c8c3d9 bump axios to 0.26.0 so that all packages use the same version 2022-04-29 13:32:54 +02:00
Pierre-Louis Mercereau
95ba1649d5 build: add baseEditUrl 2022-04-29 12:37:43 +02:00
Pierre-Louis Mercereau
4c1992068e chore: merge main 2022-04-29 12:36:39 +02:00
Szilárd Dóró
4e0aab1bb2 removed unnecessary @nhost/config package, excluded several packages from CI command 2022-04-29 12:33:53 +02:00
Pilou
a3357265ec Merge pull request #480 from nhost/docs/algolia
docs: enable algolia search
2022-04-29 12:33:20 +02:00
Pierre-Louis Mercereau
494d8127dc refactor: simplify 2022-04-29 12:31:15 +02:00
Pierre-Louis Mercereau
57b628a255 refactor: remove useless condition 2022-04-29 12:28:31 +02:00
Pierre-Louis Mercereau
98b30a5c5e Merge branch 'main' into docs/autogen-edit-page 2022-04-29 12:26:02 +02:00
Pierre-Louis Mercereau
48afcf415d feat: link the 'Edit Page' button to the source code instead of the generated file 2022-04-29 12:24:33 +02:00
Johan Eliasson
58b9488af8 update setting 2022-04-29 11:48:42 +02:00
Pilou
e49528d43e Merge pull request #488 from nhost/chore/rename-user-hooks
fix: rename user data hooks to make them all start with `userUser...`
2022-04-29 11:47:33 +02:00
Pilou
ab0f5582e5 Merge pull request #489 from nhost/docs/developers-guide
Basic developer guide
2022-04-29 11:47:17 +02:00
Pierre-Louis Mercereau
b499548503 post review 2022-04-29 10:30:29 +02:00
Pilou
fbc15cfee1 Merge pull request #452 from nhost/441-user_id-not-seen-in-the-screenshots-before-the-permissions-section-of-todoapp
docs: correct docs for `user_id` column
2022-04-29 09:43:03 +02:00
Pierre-Louis Mercereau
8788de83e8 docs: basic developer guide 2022-04-29 09:14:41 +02:00
Pierre-Louis Mercereau
1fb51a7bed fix: rename user data hooks to make them all start with userUser... 2022-04-29 08:31:32 +02:00
Pilou
365b806755 Merge pull request #487 from nhost/changeset-release/main
chore: update versions
2022-04-28 23:55:00 +02:00
github-actions[bot]
74025a2d90 chore: update versions 2022-04-28 21:51:11 +00:00
Pilou
ebd6f86ea3 Merge pull request #486 from nhost/fix/fine-tune-nextjs
fix: get the refresh token in the right place in the url
2022-04-28 23:50:19 +02:00
Pierre-Louis Mercereau
7b23d33d9b fix: get the refresh token in the right place in the url 2022-04-28 22:18:48 +02:00
Grégory D'Angelo
87fc565b14 Add content for the Next.js quickstart guide 2022-04-28 19:46:06 +02:00
Grégory D'Angelo
ed46a7a6f9 Add missing file extension 2022-04-28 19:28:51 +02:00
Grégory D'Angelo
6749bf3486 Rename file to get-started-with-nhost-cli 2022-04-28 19:26:53 +02:00
Grégory D'Angelo
b32c1bab39 Add "Get help" section 2022-04-28 19:25:17 +02:00
Pierre-Louis Mercereau
de177710f7 chore: bump correct version number, and trigger release 2022-04-28 18:39:58 +02:00
Pierre-Louis Mercereau
eebfddb48e build: bump nextjs to correct version 2022-04-28 16:52:17 +02:00
Pilou
f5df7eaa2d Merge pull request #457 from nhost/changeset-release/main
chore: update versions
2022-04-28 16:31:09 +02:00
Pierre-Louis Mercereau
0b4028b1d6 chore: remove duplicate lines in changelog 2022-04-28 15:57:20 +02:00
github-actions[bot]
f2da21026b chore: update versions 2022-04-28 13:48:50 +00:00
Pilou
a8233ea621 Merge pull request #461 from nhost/feat/get-claim
feat: add accessors for decoded access token and Hasura claims
2022-04-28 15:47:30 +02:00
Pierre-Louis Mercereau
bbebf6ade2 build: update lintstagedrc 2022-04-28 15:27:45 +02:00
Pierre-Louis Mercereau
f300d8b9f1 build: update lintstagedrc 2022-04-28 15:26:29 +02:00
Pierre-Louis Mercereau
3b625acd96 Merge branch 'main' into feat/get-claim 2022-04-28 15:24:46 +02:00
Pilou
116e23cb13 Merge pull request #459 from nhost/feat/capture-url-errors
feat: capture url errors & improved SSR / NextJs startup
2022-04-28 15:22:54 +02:00
Szilárd Dóró
1bde3e6516 dependency optimization, build improvements 2022-04-28 14:48:50 +02:00
Pierre-Louis Mercereau
954aa43e49 refactor: adjustments from review 2022-04-28 14:01:18 +02:00
Pierre-Louis Mercereau
de6f862c4c style: remove dead code and add minor piece of doc 2022-04-28 13:54:29 +02:00
Pierre-Louis Mercereau
5025333fb4 Merge branch 'main' into feat/capture-url-errors 2022-04-28 13:44:14 +02:00
Pilou
b3991ea9d9 Merge pull request #482 from nhost/docs/404
docs: custom 404 page
2022-04-28 13:42:54 +02:00
Szilárd Dóró
3674f11183 upgraded turborepo, updated turborepo commands 2022-04-28 13:31:48 +02:00
Pierre-Louis Mercereau
239db617f3 docs: clean file 2022-04-28 12:48:07 +02:00
Szilárd Dóró
76b3cb4643 Merge branch 'main' into monorepo-improvements 2022-04-28 12:34:45 +02:00
Szilárd Dóró
6d6c8b3e2e Merge pull request #481 from nhost/fix/docgen-tags 2022-04-28 12:24:03 +02:00
Grégory D'Angelo
5a06ecbb10 Create "Get started with Nhost CLI" guide 2022-04-28 11:26:17 +02:00
Pierre-Louis Mercereau
83a00bbde1 refactor: rename docgen path to .docgen 2022-04-28 10:57:44 +02:00
Pierre-Louis Mercereau
169f163c99 docs: custom 404 page 2022-04-28 10:53:35 +02:00
Szilárd Dóró
5ddd7eda22 fixed some errors caused by undefined values 2022-04-28 10:49:03 +02:00
Szilárd Dóró
556190dfc5 Merge branch 'main' into monorepo-improvements 2022-04-28 10:44:15 +02:00
Szilárd Dóró
00d50f404a temporary support for link removal from TSDoc comments, renamed __tsdoc__ folder to .docgen 2022-04-28 10:21:06 +02:00
Pierre-Louis Mercereau
60dc34a24b chore: update lock file 2022-04-28 10:12:06 +02:00
Pierre-Louis Mercereau
8cc5c94da5 refactor(vue): rename user composables, and improve authentication status composable 2022-04-28 10:11:31 +02:00
Pierre-Louis Mercereau
83952b44b5 docs(react): start using @link 2022-04-27 23:32:38 +02:00
Pierre-Louis Mercereau
e609cc3fcb docs(vue): skeleton documentation 2022-04-27 23:17:58 +02:00
Pierre-Louis Mercereau
b52b4fca2d feat: complete NextJs 2022-04-27 22:18:03 +02:00
Pierre-Louis Mercereau
4dc31bd156 build(example): disable composition option to build vue example 2022-04-27 20:20:06 +02:00
Pierre-Louis Mercereau
56b1adfa81 docs: enable algolia search 2022-04-27 17:25:34 +02:00
Pierre-Louis Mercereau
d57c0d6261 chore: merge main 2022-04-27 16:56:09 +02:00
Pierre-Louis Mercereau
9f55f4890e chore: merge main 2022-04-27 16:44:19 +02:00
Szilárd Dóró
284890b437 Merge pull request #477 from nhost/docgen-improvements
DocGen improvements
2022-04-27 16:22:05 +02:00
Szilárd Dóró
1e3cb855f0 improved function overloads in auto-generated docs 2022-04-27 16:12:41 +02:00
Pierre-Louis Mercereau
aaf575f0af chore: remove dev code 2022-04-27 16:09:30 +02:00
Pierre-Louis Mercereau
ff3427ccdb chore: update changeset title 2022-04-27 16:08:40 +02:00
Szilárd Dóró
3834d80a0a improved the way function overloads are displayed
fixed an issue where line breaks broke the layout of parameter table fragments
2022-04-27 15:57:34 +02:00
Pierre-Louis Mercereau
8fcc3fd560 Merge branch 'main' into feat/capture-url-errors 2022-04-27 15:56:04 +02:00
Pierre-Louis Mercereau
616e320421 refactor: simplify startup 2022-04-27 15:55:04 +02:00
Pilou
ff8fdc4db4 Merge pull request #476 from nhost/contributors-readme-action-84g__a20xD
contributors readme action update
2022-04-27 15:43:27 +02:00
Szilárd Dóró
b732bc51e8 fixed an issue where multiple function signatures were not rendered properly in generated docs 2022-04-27 14:42:01 +02:00
Pierre-Louis Mercereau
8b88d6c553 refactor: augment useAuthenticationState instead of creating useAuthenticationError 2022-04-27 14:26:14 +02:00
Szilárd Dóró
af192fbb66 updated lint-staged config 2022-04-27 14:23:27 +02:00
Szilárd Dóró
b7c031d7e0 added deprecation indicator to sidebar items if applicable 2022-04-27 14:21:31 +02:00
Pierre-Louis Mercereau
05e91d93a8 fix: check if window existd 2022-04-27 14:20:52 +02:00
Pierre-Louis Mercereau
261f001a99 fix(nextjs): correct refresh method 2022-04-27 14:14:46 +02:00
Szilárd Dóró
ddb965c7cf added warning message to auto-generated markdown files 2022-04-27 14:10:17 +02:00
github-actions[bot]
ff8af4912b contrib-readme-action has updated readme 2022-04-27 11:42:13 +00:00
Pilou
948aebcf42 Merge pull request #472 from jladuval/patch-1
Docs: Update event-triggers.md with environment variable example
2022-04-27 13:41:57 +02:00
Szilárd Dóró
51a4d7a343 Merge pull request #474 from nhost/fix/docs-redirects
fix: Docs redirects
2022-04-27 13:17:41 +02:00
Johan Eliasson
d521218146 Merge pull request #475 from nhost/typo-hbuyg87y9
Typo
2022-04-27 13:08:06 +02:00
Johan Eliasson
9a1685c2eb typo 2022-04-27 12:55:43 +02:00
Szilárd Dóró
fb8f58503f updated CODEOWNERS 2022-04-27 12:31:02 +02:00
Szilárd Dóró
86409c2f18 changed React Hooks redirect 2022-04-27 12:26:36 +02:00
Szilárd Dóró
f7d8c061a0 added redirects from previously removed docs 2022-04-27 12:23:57 +02:00
Szilárd Dóró
eb59a07c3f Merge pull request #453 from nhost/feat/docgen
feat: Auto-generate documentation from TSDoc
2022-04-27 12:07:58 +02:00
Szilárd Dóró
27add80f95 added index page to JavaScript docs 2022-04-27 11:59:04 +02:00
Szilárd Dóró
cc60a845f3 fixes HasuraStorageClient examples to use code block 2022-04-27 10:53:02 +02:00
Szilárd Dóró
aeea44e4e8 fixed HasuraAuthClient examples to use code block 2022-04-27 10:51:35 +02:00
Jacob Duval
d273825cee Update event-triggers.md with environment variable example
Show how environment variables are used with the correct formatting. I had to search around a while to find the correct {{}} format.
2022-04-27 10:44:57 +02:00
Szilárd Dóró
177733f4b1 added deprecation note to parameters and parameter tables 2022-04-27 10:40:50 +02:00
Szilárd Dóró
efd33a7115 updated docs according to code changes 2022-04-27 10:04:08 +02:00
Szilárd Dóró
e4fe166992 Merge branch 'main' into feat/docgen 2022-04-27 10:02:34 +02:00
Pierre-Louis Mercereau
d9f221b625 feat: get refresh token from url in Next, and remove the refresh token from the url when possible 2022-04-27 09:55:42 +02:00
Szilárd Dóró
e0f5bf3396 fixed example in hasura-auth-client 2022-04-27 09:50:23 +02:00
Szilárd Dóró
17bd23460f added lint-staged configuration 2022-04-27 09:16:12 +02:00
Pierre-Louis Mercereau
59a34143df refactor: change type to interface, adjust composable functionning to current react hook's logic 2022-04-26 17:34:42 +02:00
Szilárd Dóró
52c30c25a9 expand Reference > JavaScript menu by default 2022-04-26 17:11:00 +02:00
Szilárd Dóró
989bc54544 added support for DocGen parallelization, improved DocGen configuration 2022-04-26 17:05:07 +02:00
Szilárd Dóró
5781cb0f9c restored accidentally removed docs pages 2022-04-26 15:51:26 +02:00
Szilárd Dóró
24f9ed4c4d fixed slugs, re-generated docs 2022-04-26 15:25:31 +02:00
Szilárd Dóró
2b447af8a7 Merge branch 'feat/docgen' of https://github.com/nhost/nhost into feat/docgen 2022-04-26 14:57:06 +02:00
Szilárd Dóró
2485c83de3 updated documentation URLs, fixed auto-generated documentation slugs 2022-04-26 14:53:26 +02:00
Pilou
707877477f Merge pull request #465 from nhost/chore/inline-react-doc
docs(react): add inline documentation
2022-04-26 14:32:15 +02:00
Pierre-Louis Mercereau
756e1af52d chore: merge 2022-04-26 14:31:35 +02:00
Pierre-Louis Mercereau
7f771e2e8f pre-merge 2022-04-26 14:29:25 +02:00
Szilárd Dóró
a737863c2b added support for flattened navigation structure on References page 2022-04-26 13:32:24 +02:00
Pierre-Louis Mercereau
ca2a61089a docs: add missing backticks 2022-04-26 12:19:53 +02:00
Szilárd Dóró
7432db0fe8 created custom sidebar mapping to support appropriate structure 2022-04-26 12:10:38 +02:00
Pierre-Louis Mercereau
9c25e65df6 docs(react): add inline documentation 2022-04-26 12:06:51 +02:00
Szilárd Dóró
e345895fd8 generated React, Next.js, Nhost JS documentation, fixed issues 2022-04-26 11:55:53 +02:00
Szilárd Dóró
cba7996dcf generated React, Next.js, Nhost JS documentation, fixed issues 2022-04-26 10:58:03 +02:00
Johan Eliasson
d7ceda6ae6 Merge pull request #464 from nhost/contributors-readme-action-yLZgG3Dxtk
contributors readme action update
2022-04-26 08:36:39 +02:00
github-actions[bot]
4e19b7309d contrib-readme-action has updated readme 2022-04-25 18:21:46 +00:00
David Barroso
de8a7d5512 Merge pull request #449 from nhost/dbarroso/update-docker-compose
update hasura-storage example
2022-04-25 20:21:32 +02:00
Szilárd Dóró
69f3a84bf5 vite config to exclude external dependencies from bundle 2022-04-25 17:23:24 +02:00
Pierre-Louis Mercereau
214ae2fe19 chore: update pnpm lockfile 2022-04-25 17:16:03 +02:00
Pierre-Louis Mercereau
bc86be70ef refactor: done checking refeshIntervalTime works with Vue 2022-04-25 17:02:02 +02:00
Pierre-Louis Mercereau
8555d30dab feat: add a devTools option 2022-04-25 17:01:10 +02:00
Pierre-Louis Mercereau
6f1ca70b7a refactor: reshape file structure, hooks signatures, and use unref when possible 2022-04-25 16:13:00 +02:00
Szilárd Dóró
16dcd314bb replaced esbuild with Vite, unified entry point and publish configuration of packages 2022-04-25 14:45:14 +02:00
Pierre-Louis Mercereau
aae6524acb Merge branch 'main' into feat/vue 2022-04-25 14:32:28 +02:00
Pierre-Louis Mercereau
7e7aa5adc4 refactor: explain 2022-04-25 14:11:22 +02:00
Pierre-Louis Mercereau
1ed948952a refactor: remove mock credentials 2022-04-25 14:07:47 +02:00
Pilou
55b0a8f4b9 Merge pull request #458 from nhost/examples/xstate-inspector
react-apollo example: activate xstate inspector with an environment variable
2022-04-25 13:37:43 +02:00
Pierre-Louis Mercereau
1ce55c5568 feat: add aceessors for decoded access token and Hasura claims 2022-04-25 13:24:07 +02:00
Pierre-Louis Mercereau
fabd1da04c feat: new useAuthenticationError hook 2022-04-25 11:19:59 +02:00
Pierre-Louis Mercereau
53f5226d0c feat: capture hasura-auth errors from the url 2022-04-25 11:16:48 +02:00
Pilou
e339cba384 Merge pull request #450 from nhost/fix/filter-logs
Remove filtering of `useLayoutEffect` from logs
2022-04-25 11:14:05 +02:00
Pierre-Louis Mercereau
c14d12e04d docs: activate xstate inspector with an environment variable 2022-04-25 10:57:42 +02:00
Szilárd Dóró
03370da2f4 added DocGen support for React package, generated default React SDK references 2022-04-25 10:46:06 +02:00
Pilou
87d32b2639 Merge pull request #451 from nhost/chore/reprecate-bad-naming
Rename `autoLogin` to `autoSignIn`, and deprecate `autoLogin`
2022-04-25 10:13:08 +02:00
Pilou
61b5fb549c Merge pull request #456 from nhost/docs/use-display-name
docs: `useDisplayName` instead of `displayName`
2022-04-25 10:12:52 +02:00
Szilárd Dóró
28cd8dc5c5 resolved conflicts with main branch 2022-04-25 10:06:33 +02:00
Szilárd Dóró
fb93d8c1af Merge branch 'main' into feat/docgen 2022-04-25 10:05:41 +02:00
Pierre-Louis Mercereau
f4e6aea9c1 docs: fix incorrect example 2022-04-25 09:45:40 +02:00
Johan Eliasson
65d61cf4b8 update 2022-04-25 09:40:23 +02:00
Johan Eliasson
a8d5214b2f grammerly updates 2022-04-25 09:39:14 +02:00
Johan Eliasson
f9e5283fc3 correct docs for column 2022-04-25 09:35:18 +02:00
Pierre-Louis Mercereau
d49b837abb fix: rename autoLogin to autoSignIn, and deprecate autoLogin 2022-04-25 09:09:19 +02:00
Pierre-Louis Mercereau
49545c058b fix: remove filtering of useLayoutEffect from logs 2022-04-25 08:40:34 +02:00
David Barroso
765340f7b2 update hasura-storage example 2022-04-25 08:30:39 +02:00
Johan Eliasson
5a212aaa12 link fix 2022-04-22 22:34:45 +02:00
Pilou
2c3d9b11a6 Merge pull request #446 from nhost/changeset-release/main
chore: update versions
2022-04-22 22:33:18 +02:00
Johan Eliasson
79056d8b48 update 2022-04-22 22:30:02 +02:00
github-actions[bot]
b1678eaad3 chore: update versions 2022-04-22 20:29:10 +00:00
Pilou
f1c16dba6e Merge pull request #444 from nhost/fix/refresh-session-start
fix: fix `refreshSession`
2022-04-22 22:28:23 +02:00
Johan Eliasson
f86883df88 new menu strucutre 2022-04-22 22:20:42 +02:00
Pierre-Louis Mercereau
aa1fdf6c2c fix: fix refreshSession 2022-04-22 22:18:17 +02:00
Szilárd Dóró
e5f00394ae added tests for getNestedParametersFromParameter 2022-04-22 16:41:04 +02:00
Szilárd Dóró
dd08aef4cc added tests for helper functions, improved verbose logging 2022-04-22 15:55:08 +02:00
Szilárd Dóró
4ab85815a0 introduced support for "alias" tag, added tests for DeprecationNoteFragment and CommentTagFragment 2022-04-22 15:18:53 +02:00
Pierre-Louis Mercereau
9b834d8893 chore: change hasura-auth versions in examples 2022-04-22 13:49:15 +02:00
Pierre-Louis Mercereau
bd8ddaacc3 chore: set lint and prettier, update hasura-auth version 2022-04-22 13:48:03 +02:00
Pierre-Louis Mercereau
1cf7116bd8 chore: skeleton of a vue sdk 2022-04-22 13:43:36 +02:00
Szilárd Dóró
1b0902079b changed reference paths to use root path, improved some examples of HasuraAuthClient 2022-04-22 12:55:07 +02:00
Szilárd Dóró
f719d47ed3 created command for Storage docs generation, added initial docs generated with the tool 2022-04-22 11:23:54 +02:00
Szilárd Dóró
8cc88533b1 fixed class references 2022-04-22 10:57:41 +02:00
Szilárd Dóró
71de2bd0c5 added custom styling for optional / required labels of parameters
improved prettier formatter of classes, functions and types
2022-04-21 22:50:40 +02:00
Szilárd Dóró
66d204331b improved function signature formatting, union and intersection types 2022-04-21 22:31:17 +02:00
Szilárd Dóró
ee288fbc5f added tests for ClassTemplate, improved typings of signatures 2022-04-21 21:59:26 +02:00
Szilárd Dóró
1a38b5dca3 fixed parameter reference generator issues, added option to wrap or unwrap values to label generator 2022-04-21 19:39:38 +02:00
Szilárd Dóró
e0bd8cf14b moved docgen to packages, created temporary scripts to execute docgen procedure 2022-04-21 18:21:36 +02:00
Szilárd Dóró
1da0ff9109 fixed ESLint issues, improved error handling, improved DocGen state management 2022-04-21 14:09:44 +02:00
Szilárd Dóró
c08230ae95 disabled import sort command in DocGen because of the Prettier plugin 2022-04-21 12:04:43 +02:00
Szilárd Dóró
18df8921fd initial DocGen code 2022-04-21 11:44:31 +02:00
1609 changed files with 79943 additions and 84554 deletions

View File

@@ -1,50 +0,0 @@
{
"env": {
"browser": true,
"es6": true,
"node": true
},
"ignorePatterns": ["**/dist", "**/build", "**/.next"],
"extends": ["react-app", "plugin:react/recommended", "plugin:react-hooks/recommended"],
"parserOptions": {
// "project": "./tsconfig.json"
"project": ["packages/*/tsconfig.json", "examples/*/tsconfig.json"]
},
"plugins": ["react", "@typescript-eslint", "react-hooks", "simple-import-sort"],
"rules": {
"no-use-before-define": "off",
"simple-import-sort/exports": "error",
"simple-import-sort/imports": [
"error",
{
"groups": [
// Node.js builtins. You could also generate this regex if you use a `.js` config.
// For example: `^(${require("module").builtinModules.join("|")})(/|$)`
[
"^(assert|buffer|child_process|cluster|console|constants|crypto|dgram|dns|domain|events|fs|http|https|module|net|os|path|punycode|querystring|readline|repl|stream|string_decoder|sys|timers|tls|tty|url|util|vm|zlib|freelist|v8|process|async_hooks|http2|perf_hooks)(/.*|$)"
],
// Packages
["^\\w"],
// Internal packages.
["^(@|config/)(/*|$)"],
// Side effect imports.
["^\\u0000"],
// Parent imports. Put `..` last.
["^\\.\\.(?!/?$)", "^\\.\\./?$"],
// Other relative imports. Put same-folder imports and `.` last.
["^\\./(?=.*/)(?!/?$)", "^\\.(?!/?$)", "^\\./?$"],
// Style imports.
["^.+\\.s?css$"]
]
}
],
"import/no-anonymous-default-export": [
"error",
{
"allowArrowFunction": true,
"allowAnonymousFunction": true
}
]
}
}

View File

@@ -1,30 +0,0 @@
const esbuild = require('esbuild')
// Automatically exclude all node_modules from the bundled version
const { nodeExternalsPlugin } = require('esbuild-node-externals')
esbuild
.build({
entryPoints: ['./src/index.ts'],
outfile: 'dist/index.cjs.js',
bundle: true,
minify: true,
platform: 'node',
format: 'cjs',
sourcemap: true,
target: 'node14',
plugins: [nodeExternalsPlugin()]
})
.catch(() => process.exit(1))
esbuild
.build({
entryPoints: ['./src/index.ts'],
outfile: 'dist/index.es.js',
bundle: true,
minify: true,
platform: 'browser',
format: 'esm',
sourcemap: true,
target: 'es2019'
})
.catch(() => process.exit(1))

View File

@@ -1,7 +0,0 @@
const base = require('./jest.config.base.js')
module.exports = {
...base,
projects: ['<rootDir>/packages/*/jest.config.js'],
coverageDirectory: '<rootDir>/coverage/'
}

View File

@@ -1,50 +0,0 @@
import fs from 'fs'
import path from 'path'
import { defineConfig } from 'vite'
import dts from 'vite-plugin-dts'
import tsconfigPaths from 'vite-tsconfig-paths'
import react from '@vitejs/plugin-react'
const PWD = process.env.PWD
const pkg = require(path.join(PWD, 'package.json'))
const tsEntry = path.resolve(PWD, 'src/index.ts')
const entry = fs.existsSync(tsEntry) ? tsEntry : tsEntry.replace('.ts', '.tsx')
/**
* @type {import('vite').UserConfig}
*/
export default defineConfig({
plugins: [
react(),
tsconfigPaths(),
dts({
exclude: ['**/*.spec.ts', '**/*.test.ts', '**/tests/**'],
afterBuild: () => {
const types = fs.readdirSync(path.join(PWD, 'dist/src'))
types.forEach((file) => {
fs.renameSync(path.join(PWD, 'dist/src', file), path.join(PWD, 'dist', file))
})
fs.rmdirSync(path.join(PWD, 'dist/src'))
}
})
],
build: {
lib: {
entry,
name: pkg.name,
fileName: 'index'
},
rollupOptions: {
external: ['react', '@nhost/react'],
output: {
globals: {
react: 'react',
'@nhost/react': '@nhost/react'
}
}
}
}
})

14
.github/CODEOWNERS vendored
View File

@@ -1,7 +1,13 @@
# Documentation
# https://help.github.com/en/articles/about-code-owners
/packages @plmercereau
/.github/workflows @plmercereau
/docs/ @guicurcio
/examples/ @plmercereau @guicurcio @FuzzyReason
/packages @plmercereau @szilarddoro
/packages/docgen @szilarddoro
/packages/stripe-graphql-js @elitan
/.github @plmercereau
/docs/ @guicurcio @elitan
/config/ @plmercereau @szilarddoro
/examples/ @plmercereau
/examples/codegen-react-apollo @elitan @plmercereau
/examples/codegen-react-query @elitan @plmercereau
/examples/react-apollo-crm @elitan @plmercereau

View File

@@ -0,0 +1,23 @@
name: Install Node and package dependencies
description: 'Install Node dependencies with pnpm'
runs:
using: 'composite'
steps:
- uses: pnpm/action-setup@v2.2.3
with:
version: 7.9.1
run_install: false
- name: Use Node.js 16
uses: actions/setup-node@v2
with:
node-version: 16
cache: 'pnpm'
# * Install package dependencies. As cache is enabled, it will cache/restore downloaded files
- shell: bash
name: Install packages
run: pnpm install --frozen-lockfile
# * Build all Nhost packages as they are all supposed to be tested.
# * They are reused through the Turborepo cache
- shell: bash
name: Build packages
run: pnpm build

View File

@@ -5,10 +5,10 @@ on:
branches: [main]
paths-ignore:
- 'docs/**'
- 'templates/**'
- 'examples/**'
- 'assets/**'
- '**.md'
- '!.changeset/**'
- 'LICENSE'
jobs:
@@ -21,20 +21,9 @@ jobs:
with:
fetch-depth: 0
- uses: pnpm/action-setup@v2.1.0
with:
version: 6.32.3
# run_install: true
- name: Use Node.js 17
uses: actions/setup-node@v2
with:
node-version: '17.8.0'
cache: 'pnpm'
- name: Pick the right npm version
# * See: https://github.com/pnpm/pnpm/issues/4348
run: npm install --global npm@8.4
- name: Install dependencies
run: pnpm install
# * Install Node and dependencies
- name: Install Node and dependencies
uses: ./.github/actions/install-dependencies
- name: Create PR or Publish release
id: changesets
uses: changesets/action@v1

View File

@@ -1,70 +1,114 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
# Poached from https://github.com/hayes/pothos/tree/main/.github/workflows, thanks to the original author
name: Node.js CI
name: Tests
on:
push:
branches: [main]
paths-ignore:
- 'docs/**'
- 'templates/**'
- 'examples/**'
- 'assets/**'
- '**.md'
- 'LICENSE'
pull_request:
branches: [main]
types: [opened, synchronize]
paths-ignore:
- 'docs/**'
- 'templates/**'
- 'examples/**'
- 'assets/**'
- '**.md'
- 'LICENSE'
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: nhost
jobs:
build:
name: Build @nhost packages
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14, 16]
steps:
- uses: actions/checkout@v2
- name: Install nhost CLI
run: curl -L https://raw.githubusercontent.com/nhost/cli/main/get.sh | bash
- name: Start Nhost Backend
# * Install Node and dependencies. Package downloads will be cached for the next jobs.
- name: Install Node and dependencies
uses: ./.github/actions/install-dependencies
# * List packagesthat has an `e2e` script, except the root, and return an array of their name and path
- name: List examples with an e2e script
id: set-matrix
run: |
cp -R examples/testing-project /tmp/
cd /tmp/testing-project
nhost dev &
- uses: pnpm/action-setup@v2.2.1
PACKAGES=$(pnpm recursive list --depth -1 --parseable --filter=!nhost-root \
| xargs -I@ jq "if (.scripts.e2e | length) != 0 then {name: .name, path: \"@\"} else null end" @/package.json \
| awk "!/null/" \
| jq -c --slurp)
echo "::set-output name=matrix::$PACKAGES"
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
e2e:
name: 'e2e: ${{ matrix.package.name }}'
needs: build
strategy:
# * Don't cancel other matrices when one fails
fail-fast: false
matrix:
package: ${{ fromJson(needs.build.outputs.matrix) }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# * Install Nhost CLI if a `nhost/config.yaml` file is found
- name: Install Nhost CLI
if: hashFiles(format('{0}/nhost/config.yaml', matrix.package.path)) != ''
run: curl -L https://raw.githubusercontent.com/nhost/cli/main/get.sh | bash
# * Install Node and dependencies. Package dependencies won't be downloaded again as they have been cached by the `build` job.
- name: Install Node and dependencies
uses: ./.github/actions/install-dependencies
# TODO ugly - check CYPRESS_CACHE_FOLDER
- name: Install Cypress
run: pnpm install -w cypress
# * Run the `ci` script of the current package of the matrix. Dependencies build is cached by Turborepo
- name: Run e2e test
run: pnpm --filter="${{ matrix.package.name }}" run e2e
- id: file-name
if: ${{ failure() }}
name: Tranform package name into a valid file name
run: |
PACKAGE_FILE_NAME=$(echo "${{ matrix.package.name }}" | sed 's/@//g; s/\//-/g')
echo "::set-output name=fileName::$PACKAGE_FILE_NAME"
# * Run this step only if the previous step failed, and some Cypress screenshots/videos exist
- name: Upload Cypress videos and screenshots
if: ${{ failure() && hashFiles(format('{0}/cypress/screenshots/**', matrix.package.path), format('{0}/cypress/videos/**', matrix.package.path)) != ''}}
uses: actions/upload-artifact@v3
with:
version: 6.32.3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
name: cypress-${{ steps.file-name.outputs.fileName }}
path: |
${{format('{0}/cypress/screenshots/**', matrix.package.path)}}
${{format('{0}/cypress/videos/**', matrix.package.path)}}
unit:
name: Unit tests
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# * Install Node and dependencies. Package dependencies won't be downloaded again as they have been cached by the `build` job.
- name: Install Node and dependencies
uses: ./.github/actions/install-dependencies
# * Run every `test` script in the workspace . Dependencies build is cached by Turborepo
- name: Run unit tests
run: pnpm run test
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
- name: Cache turbo
uses: actions/cache@v2
with:
path: ./node_modules/.cache/turbo
key: turbo-${{ github.job }}-${{ github.ref_name }}-${{ github.sha }}
restore-keys: |
turbo-${{ github.job }}-${{ github.ref_name }}-
- name: Install dependencies
run: pnpm install
- name: Wait for Nhost
run: pnpm run wait
- name: Build, tests and lint
run: pnpm run ci
files: '**/coverage/coverage-final.json'
name: codecov-umbrella
- name: Create summary
run: |
echo '### Code coverage' >> $GITHUB_STEP_SUMMARY
echo 'Visit [codecov](https://app.codecov.io/gh/nhost/nhost/) to see the code coverage reports' >> $GITHUB_STEP_SUMMARY
lint:
name: Lint
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# * Install Node and dependencies. Package dependencies won't be downloaded again as they have been cached by the `build` job.
- name: Install Node and dependencies
uses: ./.github/actions/install-dependencies
# * Run every `lint` script in the workspace . Dependencies build is cached by Turborepo
- name: Lint
run: pnpm run lint

21
.gitignore vendored
View File

@@ -12,14 +12,13 @@ logs/
.idea/
.npm/
.vagrant/
/.vscode/
.eslintcache
.yarnclean
.husky
# Directories
coverage/
dist/
umd/
lib/
node_modules/
tmp/
@@ -33,16 +32,15 @@ tmp/
*.map
todo.md
# Generated configs
# Config files that are not part of the repository root anymore. Should be removed in the future.
/.eslintignore
/.eslintrc
/.prettierignore
/prettier.config.js
/.eslintrc*
/vite.*.js
/jest.*.js
/*tsconfig*.json
/esbuild.*.js
!.config/**
!config/**
*.tsbuildinfo
@@ -50,4 +48,11 @@ todo.md
.netlify
.monorepo-example
.next
.next
# TypeDoc output
.docgen
# Nhost CLI data
.nhost

View File

@@ -11,6 +11,11 @@ module.exports = {
tabWidth: 2,
trailingComma: 'none',
useTabs: false,
// TODO: add import sort configuration to match ESLint rules
// plugins: ['./node_modules/@trivago/prettier-plugin-sort-imports'],
// importOrderSeparation: true,
// importOrderSortSpecifiers: true
plugins: [],
overrides: [
{
files: ['*.json', '*.yaml'],

5
.vscode/settings.json vendored Normal file
View File

@@ -0,0 +1,5 @@
{
"editor.codeActionsOnSave": {
"source.organizeImports": true
}
}

View File

@@ -24,6 +24,8 @@ If you find an Issue that addresses the problem you're having, please add your r
### Pull Requests
Please have a look at our [developers guide](https://github.com/nhost/nhost/blob/main/DEVELOPERS.md) to start coding!
PRs to our libraries are always welcome and can be a quick way to get your fix or improvement slated for the next release. In general, PRs should:
- Only fix/add the functionality in question **OR** address wide-spread whitespace/style issues, not both.

103
DEVELOPERS.md Normal file
View File

@@ -0,0 +1,103 @@
# Developer guide
## Requirements
- We use [pnpm](https://pnpm.io/) as a package manager to speed up development and builds, and as a basis for our monorepo. You need to make sure it's installed on your machine. There are [several ways to install it](https://pnpm.io/installation), but the easiest way is with `npm`:
```sh
$ npm install -g pnpm
```
- Our tests and examples use the Nhost CLI, to run the backend services locally. You can follow the installation instructions in [our documentation](https://docs.nhost.io/get-started/cli-workflow/install-cli).
## Get started
### Installation
First, clone this repository:
```sh
git clone https://github.com/nhost/nhost
```
Then, install the dependencies with `pnpm`:
```sh
$ cd nhost
$ pnpm install
```
### Development
Although package references are correctly updated on the fly for TypeScript, example projects won't
see the changes because they are depending on the build output. To fix this, you can run packages
in development mode.
Running packages in development mode is as simple as:
```sh
$ pnpm dev
```
Our packages are linked together using [PNPM's workspace](https://pnpm.io/workspaces) feature. Vite automatically detects changes in the dependencies and rebuilds everything, so that the changes are immediately reflected in the other packages.
### Use examples
Examples are a great way to test your changes in practice. Make sure you've `pnpm dev` running in your terminal and then run an example.
Let's follow the instructions to run [react-apollo example](https://github.com/nhost/nhost/blob/main/examples/react-apollo/README.md).
## Run the documentation website locally
The easier way to contribute to our documentation is to go to the `docs` folder and follow the [instructions to start local development](https://github.com/nhost/nhost/blob/main/docs/README.md):
```sh
$ cd docs
# not necessary if you've already done this step somewhere in the repository
$ pnpm install
$ pnpm start
```
## Run test suites
### Unit tests
You can run the unit tests with the following command from the repository root:
```sh
$ pnpm test
```
### End-to-end tests
Each package that defines end-to-end tests embeds their own Nhost configuration, that will be automatically when running the tests. As a result, you must make sure you are not running the Nhost CLI before running the tests.
You can run the e2e tests with the following command from the repository root:
```sh
$ pnpm e2e
```
## Changesets
If you've made changes to the packages, you must describe those changes so that they can be reflected in the next release.
We use [changesets](https://github.com/changesets/changesets) to support our versioning and release workflows. When you submit a pull request, a bot checks if some changesets are present, and if not, it directs you to add them.
The most comprehensive way to add a changeset is to run the following command in the repository root:
```sh
$ pnpm changeset
```
This will create a file in the `.changeset` directory. You can edit it to give more details about the change you just made.
You can take a look at the changeset documentation: [How to add a changeset](https://github.com/changesets/changesets/blob/main/docs/adding-a-changeset.md).
## Committing changes
You'll notice that `git commit` takes a few seconds to run. We set a commit hook that scans the changes in the code, automatically generates documentation from the inline [TSDoc](https://tsdoc.org/) annotations, and adds these generated documentation files to the commit. They automatically update the [reference documentation](https://docs.nhost.io/reference).
<!-- ## Good practices
- lint
- prettier
- documentation -->

271
README.md
View File

@@ -1,18 +1,18 @@
![Nhost](https://imgur.com/fGo6E4d.png)
![Nhost](https://i.imgur.com/ZenoUlM.png)
<div align="center">
# Nhost
<a href="https://docs.nhost.io/get-started">Quickstart</a>
<a href="https://docs.nhost.io/#quickstart">Quickstart</a>
<span>&nbsp;&nbsp;•&nbsp;&nbsp;</span>
<a href="http://nhost.io/">Website</a>
<span>&nbsp;&nbsp;•&nbsp;&nbsp;</span>
<a href="https://docs.nhost.io/get-started">Docs</a>
<a href="https://docs.nhost.io">Docs</a>
<span>&nbsp;&nbsp;•&nbsp;&nbsp;</span>
<a href="https://nhost.io/blog">Blog</a>
<span>&nbsp;&nbsp;•&nbsp;&nbsp;</span>
<a href="https://twitter.com/nhostio">Twitter</a>
<a href="https://twitter.com/nhost">Twitter</a>
<span>&nbsp;&nbsp;•&nbsp;&nbsp;</span>
<a href="https://nhost.io/discord">Discord</a>
<br />
@@ -20,19 +20,19 @@
<hr />
</div>
**Nhost is an open-source GraphQL backend,** built with the following things in mind:
**Nhost is an open source Firebase alternative with GraphQL,** built with the following things in mind:
- Open-Source
- Developer Productivity
- SQL
- Open Source
- GraphQL
- SQL
- Great Developer Experience
Nhost consists of open source software:
- Database: [PostgreSQL](https://www.postgresql.org/)
- Instant GraphQL API: [Hasura](https://hasura.io/)
- Authentication: [Hasura Auth](https://github.com/nhost/hasura-auth/)
- Storage: [Hasura Storage](https://hub.docker.com/r/nhost/hasura-storage)
- Storage: [Hasura Storage](https://github.com/nhost/hasura-storage)
- Serverless Functions: Node.js (JavaScript and TypeScript)
- [Nhost CLI](https://docs.nhost.io/reference/cli) for local development
@@ -47,19 +47,19 @@ Nhost consists of open source software:
Visit [https://docs.nhost.io](http://docs.nhost.io) for the complete documentation.
# How to get started
# Get Started
### Option 1: One-click deployment with Nhost (recommended)
## Option 1: Nhost Hosted Platform
1. Create [Nhost account](https://app.nhost.io) (you can use GitHub to sign up)
2. Create Nhost app
3. Done!
1. Sign in to [Nhost](https://app.nhost.io).
2. Create Nhost app.
3. Done.
### Option 2: Self-hosting
## Option 2: Self-hosting
Since Nhost is 100% open source, you can self-host the whole Nhost stack. Check out the example [docker-compose file](https://github.com/nhost/nhost/tree/main/examples/docker-compose) to self-host Nhost.
## Sign in a user and make your first GraphQL query
## Sign In and Make a Graphql Request
Install the `@nhost/nhost-js` package and start build your app:
@@ -67,7 +67,8 @@ Install the `@nhost/nhost-js` package and start build your app:
import { NhostClient } from '@nhost/nhost-js'
const nhost = new NhostClient({
backendUrl: 'https://awesome-app.nhost.run'
subdomain: '<your-subdomain>',
region: '<your-region>'
})
await nhost.auth.signIn({ email: 'elon@musk.com', password: 'spaceX' })
@@ -86,23 +87,24 @@ await nhost.graphql.request(`{
Nhost is frontend agnostic, which means Nhost works with all frontend frameworks.
<div align="center">
<a href="https://github.com/nhost/nhost/tree/main/templates/web/nextjs-apollo"><img src="assets/nextjs.svg"/></a>
<a href="https://github.com/nhost/nhost/tree/main/examples/nuxt-apollo"><img src="assets/nuxtjs.svg"/></a>
<a href="https://github.com/nhost/nhost/tree/main/templates/web/react-apollo"><img src="assets/react.svg"/></a>
<img src="assets/react-native.svg"/>
<a href="https://github.com/nhost/nhost/tree/main/packages/nhost-js"><img src="assets/svelte.svg"/></a>
<a href="https://github.com/nhost/nhost/tree/main/packages/nhost-js"><img src="assets/vuejs.svg"/></a>
<a href="https://docs.nhost.io/platform/quickstarts/nextjs"><img src="assets/nextjs.svg"/></a>
<a href="https://docs.nhost.io/reference/javascript"><img src="assets/nuxtjs.svg"/></a>
<a href="https://docs.nhost.io/platform/quickstarts/react"><img src="assets/react.svg"/></a>
<a href="https://docs.nhost.io/reference/javascript"><img src="assets/react-native.svg"/></a>
<a href="https://docs.nhost.io/reference/javascript"><img src="assets/svelte.svg"/></a>
<a href="https://docs.nhost.io/platform/quickstarts/vue"><img src="assets/vuejs.svg"/></a>
</div>
# Resources
Nhost libraries and tools
- [JavaScript/TypeScript SDK](https://docs.nhost.io/reference/sdk)
- [JavaScript/TypeScript SDK](https://docs.nhost.io/reference/javascript)
- [Dart and Flutter SDK](https://github.com/nhost/nhost-dart)
- [Nhost CLI](https://docs.nhost.io/reference/cli)
- [Nhost React](https://docs.nhost.io/reference/react)
- [Nhost Next.js](https://docs.nhost.io/reference/nextjs)
- [Nhost Vue](https://docs.nhost.io/reference/vue)
## Community ❤️
@@ -114,13 +116,17 @@ Also, follow Nhost on [GitHub Discussions](https://github.com/nhost/nhost/discus
This repository, and most of our other open source projects, are licensed under the MIT license.
<a href="https://runacap.com/ross-index/q1-2022/" target="_blank" rel="noopener">
<img style="width: 260px; height: 56px" src="https://runacap.com/wp-content/uploads/2022/06/ROSS_badge_black_Q1_2022.svg" alt="ROSS Index - Fastest Growing Open-Source Startups in Q1 2022 | Runa Capital" width="260" height="56" />
</a>
### How to contribute
Here are some ways of contributing to making Nhost better:
- **[Try out Nhost](https://docs.nhost.io/get-started/quick-start)**, and think of ways to make the service better. Let us know here on GitHub.
- Join our [Discord](https://discord.com/invite/9V7Qb2U) and connect with other members to share and learn from.
- Send a pull request to any of our [open source repositories](https://github.com/nhost) on Github. Check our [contribution guide](https://github.com/nhost/nhost/blob/main/CONTRIBUTING.md) for more details about how to contribute. We're looking forward to your contribution!
- Send a pull request to any of our [open source repositories](https://github.com/nhost) on Github. Check our [contribution guide](https://github.com/nhost/nhost/blob/main/CONTRIBUTING.md) and our [developers guide](https://github.com/nhost/nhost/blob/main/DEVELOPERS.md) for more details about how to contribute. We're looking forward to your contribution!
### Contributors
@@ -141,13 +147,6 @@ Here are some ways of contributing to making Nhost better:
<sub><b>Johan Eliasson</b></sub>
</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"/>
<br />
<sub><b>Szilárd Dóró</b></sub>
</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"/>
@@ -156,10 +155,17 @@ Here are some ways of contributing to making Nhost better:
</a>
</td>
<td align="center">
<a href="https://github.com/subatuba21">
<img src="https://avatars.githubusercontent.com/u/34824571?v=4" width="100;" alt="subatuba21"/>
<a href="https://github.com/gdangelo">
<img src="https://avatars.githubusercontent.com/u/4352286?v=4" width="100;" alt="gdangelo"/>
<br />
<sub><b>Subha Das</b></sub>
<sub><b>Grégory D'Angelo</b></sub>
</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"/>
<br />
<sub><b>Szilárd Dóró</b></sub>
</a>
</td>
<td align="center">
@@ -170,6 +176,13 @@ Here are some ways of contributing to making Nhost better:
</a>
</td></tr>
<tr>
<td align="center">
<a href="https://github.com/subatuba21">
<img src="https://avatars.githubusercontent.com/u/34824571?v=4" width="100;" alt="subatuba21"/>
<br />
<sub><b>Subha Das</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/sebagudelo">
<img src="https://avatars.githubusercontent.com/u/43288271?v=4" width="100;" alt="sebagudelo"/>
@@ -185,12 +198,27 @@ Here are some ways of contributing to making Nhost better:
</a>
</td>
<td align="center">
<a href="https://github.com/gdangelo">
<img src="https://avatars.githubusercontent.com/u/4352286?v=4" width="100;" alt="gdangelo"/>
<a href="https://github.com/timpratim">
<img src="https://avatars.githubusercontent.com/u/32492961?v=4" width="100;" alt="timpratim"/>
<br />
<sub><b>Grégory D'Angelo</b></sub>
<sub><b>Pratim</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/chrtze">
<img src="https://avatars.githubusercontent.com/u/3797215?v=4" width="100;" alt="chrtze"/>
<br />
<sub><b>Christopher Möller</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">
<a href="https://github.com/FuzzyReason">
<img src="https://avatars.githubusercontent.com/u/62517920?v=4" width="100;" alt="FuzzyReason"/>
@@ -198,6 +226,20 @@ Here are some ways of contributing to making Nhost better:
<sub><b>Vadim Smirnov</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/ejkkan">
<img src="https://avatars.githubusercontent.com/u/32518962?v=4" width="100;" alt="ejkkan"/>
<br />
<sub><b>Erik Magnusson</b></sub>
</a>
</td>
<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>
<td align="center">
<a href="https://github.com/subhendukundu">
<img src="https://avatars.githubusercontent.com/u/20059141?v=4" width="100;" alt="subhendukundu"/>
@@ -206,10 +248,17 @@ Here are some ways of contributing to making Nhost better:
</a>
</td>
<td align="center">
<a href="https://github.com/chrtze">
<img src="https://avatars.githubusercontent.com/u/3797215?v=4" width="100;" alt="chrtze"/>
<a href="https://github.com/heygambo">
<img src="https://avatars.githubusercontent.com/u/449438?v=4" width="100;" alt="heygambo"/>
<br />
<sub><b>Christopher Möller</b></sub>
<sub><b>Christian Gambardella</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/dbarrosop">
<img src="https://avatars.githubusercontent.com/u/6246622?v=4" width="100;" alt="dbarrosop"/>
<br />
<sub><b>David Barroso</b></sub>
</a>
</td></tr>
<tr>
@@ -220,6 +269,13 @@ Here are some ways of contributing to making Nhost better:
<sub><b>Filip Hájek</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/MelodicCrypter">
<img src="https://avatars.githubusercontent.com/u/18341500?v=4" width="100;" alt="MelodicCrypter"/>
<br />
<sub><b>Hugh Caluscusin</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/jerryjappinen">
<img src="https://avatars.githubusercontent.com/u/1101002?v=4" width="100;" alt="jerryjappinen"/>
@@ -227,6 +283,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"/>
@@ -235,10 +298,18 @@ Here are some ways of contributing to making Nhost better:
</a>
</td>
<td align="center">
<a href="https://github.com/timpratim">
<img src="https://avatars.githubusercontent.com/u/32492961?v=4" width="100;" alt="timpratim"/>
<a href="https://github.com/nbourdin">
<img src="https://avatars.githubusercontent.com/u/5602476?v=4" width="100;" alt="nbourdin"/>
<br />
<sub><b>Pratim</b></sub>
<sub><b>Nicolas Bourdin</b></sub>
</a>
</td></tr>
<tr>
<td align="center">
<a href="https://github.com/piromsurang">
<img src="https://avatars.githubusercontent.com/u/17776837?v=4" width="100;" alt="piromsurang"/>
<br />
<sub><b>Piromsurang Rungserichai</b></sub>
</a>
</td>
<td align="center">
@@ -248,20 +319,41 @@ Here are some ways of contributing to making Nhost better:
<sub><b>Savin Vadim</b></sub>
</a>
</td>
<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">
<img src="https://avatars.githubusercontent.com/u/49474412?v=4" width="100;" alt="muttenzer"/>
<br />
<sub><b>Muttenzer</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/ahmic">
<img src="https://avatars.githubusercontent.com/u/13452362?v=4" width="100;" alt="ahmic"/>
<br />
<sub><b>Amir Ahmic</b></sub>
</a>
</td></tr>
<tr>
</td>
<td align="center">
<a href="https://github.com/akd-io">
<img src="https://avatars.githubusercontent.com/u/30059155?v=4" width="100;" alt="akd-io"/>
<br />
<sub><b>Anders Kjær Damgaard</b></sub>
</a>
</td></tr>
<tr>
<td align="center">
<a href="https://github.com/Sonichigo">
<img src="https://avatars.githubusercontent.com/u/53110238?v=4" width="100;" alt="Sonichigo"/>
<br />
<sub><b>Animesh Pathak</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/rustyb">
@@ -270,6 +362,20 @@ Here are some ways of contributing to making Nhost better:
<sub><b>Colin Broderick</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/d4g0">
<img src="https://avatars.githubusercontent.com/u/34744883?v=4" width="100;" alt="d4g0"/>
<br />
<sub><b>Dago</b></sub>
</a>
</td>
<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">
<img src="https://avatars.githubusercontent.com/u/489221?v=4" width="100;" alt="dohomi"/>
@@ -278,12 +384,13 @@ Here are some ways of contributing to making Nhost better:
</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"/>
<a href="https://github.com/gaurav1999">
<img src="https://avatars.githubusercontent.com/u/20752142?v=4" width="100;" alt="gaurav1999"/>
<br />
<sub><b>Gavan Wilhite</b></sub>
<sub><b>Gaurav Agrawal</b></sub>
</a>
</td>
</td></tr>
<tr>
<td align="center">
<a href="https://github.com/alveshelio">
<img src="https://avatars.githubusercontent.com/u/8176422?v=4" width="100;" alt="alveshelio"/>
@@ -297,8 +404,50 @@ Here are some ways of contributing to making Nhost better:
<br />
<sub><b>Hoang Do</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/eltociear">
<img src="https://avatars.githubusercontent.com/u/22633385?v=4" width="100;" alt="eltociear"/>
<br />
<sub><b>Ikko Ashimine</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/jladuval">
<img src="https://avatars.githubusercontent.com/u/1935359?v=4" width="100;" alt="jladuval"/>
<br />
<sub><b>Jacob Duval</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/leothorp">
<img src="https://avatars.githubusercontent.com/u/12928449?v=4" width="100;" alt="leothorp"/>
<br />
<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></tr>
<tr>
<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>
<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"/>
@@ -313,6 +462,28 @@ Here are some ways of contributing to making Nhost better:
<sub><b>Quentin Decré</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/altschuler">
<img src="https://avatars.githubusercontent.com/u/956928?v=4" width="100;" alt="altschuler"/>
<br />
<sub><b>Simon Altschuler</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/atapas">
<img src="https://avatars.githubusercontent.com/u/3633137?v=4" width="100;" alt="atapas"/>
<br />
<sub><b>Tapas Adhikary</b></sub>
</a>
</td></tr>
<tr>
<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"/>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 53 KiB

After

Width:  |  Height:  |  Size: 61 KiB

65
config/.eslint.base.js Normal file
View File

@@ -0,0 +1,65 @@
module.exports = {
env: {
browser: true,
es6: true,
node: true
},
ignorePatterns: [
'dist',
'umd',
'build',
'.next',
'node_modules',
'tsup.config.ts',
'__tests__',
'__mocks__',
'*.test.ts',
'*.test.tsx',
'*.spec.ts',
'*.spec.tsx',
'tests/**/*.ts',
'tests/**/*.d.ts'
],
plugins: ['@typescript-eslint', 'simple-import-sort', 'cypress'],
extends: ['plugin:cypress/recommended'],
parserOptions: {
ecmaVersion: 2020,
sourceType: 'module'
},
rules: {
'react/prop-types': 'off',
'no-use-before-define': 'off',
'simple-import-sort/exports': 'error',
'simple-import-sort/imports': [
'error',
{
groups: [
// Node.js builtins. You could also generate this regex if you use a `.js` config.
// For example: `^(${require("module").builtinModules.join("|")})(/|$)`
[
'^(assert|buffer|child_process|cluster|console|constants|crypto|dgram|dns|domain|events|fs|http|https|module|net|os|path|punycode|querystring|readline|repl|stream|string_decoder|sys|timers|tls|tty|url|util|vm|zlib|freelist|v8|process|async_hooks|http2|perf_hooks)(/.*|$)'
],
// Packages
['^\\w'],
// Internal packages.
['^(@|config/)(/*|$)'],
// Side effect imports.
['^\\u0000'],
// Parent imports. Put `..` last.
['^\\.\\.(?!/?$)', '^\\.\\./?$'],
// Other relative imports. Put same-folder imports and `.` last.
['^\\./(?=.*/)(?!/?$)', '^\\.(?!/?$)', '^\\./?$'],
// Style imports.
['^.+\\.s?css$']
]
}
],
'import/no-anonymous-default-export': [
'error',
{
allowArrowFunction: true,
allowAnonymousFunction: true
}
]
}
}

12
config/.eslintrc.js Normal file
View File

@@ -0,0 +1,12 @@
const base = require('./.eslint.base')
module.exports = {
...base,
extends: [
...base.extends,
'react-app',
'plugin:react/recommended',
'plugin:react-hooks/recommended',
'plugin:react/jsx-runtime'
],
plugins: [...base.plugins, 'react', 'react-hooks']
}

13
config/.eslintrc.vue.js Normal file
View File

@@ -0,0 +1,13 @@
const base = require('./.eslint.base')
module.exports = {
...base,
extends: [...base.extends, 'plugin:import/recommended', 'plugin:import/typescript'],
parser: 'vue-eslint-parser',
parserOptions: {
...base.parserOptions,
parser: '@typescript-eslint/parser'
},
rules: {
'vue/html-self-closing': 'off'
}
}

1
config/.husky/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
_

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

@@ -7,7 +7,6 @@ module.exports = {
testRegex: '(/tests/.*.(test|spec)).(jsx?|tsx?)$',
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
collectCoverage: true,
// coveragePathIgnorePatterns: ['(tests/.*.mock).(jsx?|tsx?)$'],
verbose: true,
testTimeout: 30000,
globals: {

15
config/jest.config.js Normal file
View File

@@ -0,0 +1,15 @@
module.exports = {
rootDir: process.cwd(),
preset: 'ts-jest',
collectCoverage: true,
coverageProvider: 'v8',
coverageDirectory: '<rootDir>/coverage',
clearMocks: true,
verbose: true,
testTimeout: 30000,
globals: {
'ts-jest': {
isolatedModules: true
}
}
}

View File

@@ -0,0 +1,8 @@
{
"$schema": "https://json.schemastore.org/tsconfig",
"display": "React Library",
"extends": "./tsconfig.base.json",
"compilerOptions": {
"jsx": "preserve"
}
}

57
config/tsconfig.base.json Normal file
View File

@@ -0,0 +1,57 @@
{
"$schema": "https://json.schemastore.org/tsconfig",
"display": "Default",
"compilerOptions": {
"composite": false,
"declaration": true,
"declarationMap": true,
"strict": true,
"isolatedModules": true,
"forceConsistentCasingInFileNames": true,
"allowSyntheticDefaultImports": true,
"skipLibCheck": true,
"moduleResolution": "node",
"target": "ES6",
"module": "CommonJS",
"lib": [
"es5",
"dom",
"es2015.promise",
"es2015.symbol",
"es2015.iterable",
"es2015.collection",
"es2015.symbol.wellknown",
"es2015.core",
"es2017.object",
"es2017.string"
],
"resolveJsonModule": true,
"esModuleInterop": true,
"sourceMap": true,
"types": ["node"],
"typeRoots": [
"./node_modules/@types", "**/*/dist", "**/*/build", "**/*/.next", "**/*/umd"
],
"paths": {
"@nhost/apollo": ["../packages/apollo/src/index.ts"],
"@nhost/core": ["../packages/core/src/index.ts"],
"@nhost/docgen": ["../packages/docgen/src/index.ts"],
"@nhost/hasura-auth-js": ["../packages/hasura-auth-js/src/index.ts"],
"@nhost/hasura-storage-js": ["../packages/hasura-storage-js/src/index.ts"],
"@nhost/nextjs": ["../packages/nextjs/src/index.ts"],
"@nhost/nhost-js": ["../packages/nhost-js/src/index.ts"],
"@nhost/react": ["../packages/react/src/index.ts"],
"@nhost/react-apollo": ["../packages/react-apollo/src/index.ts"],
"@nhost/react-auth": ["../packages/react-auth/src/index.ts"],
"@nhost/vue": ["../packages/vue/src/index.ts"]
}
},
"exclude": [
"node_modules",
"**/*/dist",
"**/*/build",
"**/*/.next",
"**/*/__tests__",
"**/*/__mocks__"
]
}

76
config/vite.lib.config.js Normal file
View File

@@ -0,0 +1,76 @@
import fs from 'fs'
import path from 'path'
import { defineConfig } from 'vite'
import dts from 'vite-plugin-dts'
import tsconfigPaths from 'vite-tsconfig-paths'
const PWD = process.env.PWD
const pkg = require(path.join(PWD, 'package.json'))
const tsEntry = path.resolve(PWD, 'src/index.ts')
const entry = fs.existsSync(tsEntry) ? tsEntry : tsEntry.replace('.ts', '.tsx')
const deps = [...Object.keys(Object.assign({}, pkg.peerDependencies, pkg.dependencies))]
export default defineConfig({
plugins: [
tsconfigPaths(),
dts({
exclude: ['**/*.spec.ts', '**/*.test.ts', '**/tests/**'],
afterBuild: () => {
const types = fs.readdirSync(path.join(PWD, 'dist/src'))
types.forEach((file) => {
fs.renameSync(path.join(PWD, 'dist/src', file), path.join(PWD, 'dist', file))
})
fs.rmdirSync(path.join(PWD, 'dist/src'))
}
})
],
test: {
globals: true,
environment: 'jsdom',
reporters: 'verbose',
include: [`${PWD}/src/**/*.{spec,test}.{ts,tsx}`, `${PWD}/tests/**/*.{spec,test}.{ts,tsx}`],
// Note: temporarily disabled threads, because of a bug in vitest
// https://github.com/vitest-dev/vitest/issues/1171
threads: false,
coverage: {
enabled: process.env.CI === 'true',
reporter: ['json']
}
},
build: {
sourcemap: true,
lib: {
entry,
name: pkg.name,
fileName: (format) => (format === 'cjs' ? `index.cjs.js` : `index.esm.js`),
formats: ['cjs', 'es']
},
rollupOptions: {
external: (id) => deps.some((dep) => id.startsWith(dep)),
output: {
globals: {
graphql: 'graphql',
'@apollo/client': '@apollo/client',
'@apollo/client/core': '@apollo/client/core',
'@apollo/client/link/context': '@apollo/client/link/context',
'@apollo/client/react': '@apollo/client/react',
'@apollo/client/link/subscriptions': '@apollo/client/link/subscriptions',
'@apollo/client/utilities': '@apollo/client/utilities',
'graphql-ws': 'graphql-ws',
xstate: 'xstate',
axios: 'axios',
'js-cookie': 'Cookies',
react: 'React',
'react-dom': 'ReactDOM',
'react/jsx-runtime': '_jsx',
'@nhost/react': '@nhost/react',
vue: 'Vue',
'vue-demi': 'vue-demi'
}
}
}
}
})

View File

@@ -0,0 +1,13 @@
import { defineConfig } from 'vite'
import viteLibConfig from './vite.lib.config'
export default defineConfig({
...viteLibConfig,
build: {
...viteLibConfig.build,
watch: {
buildDelay: 500
}
}
})

View File

@@ -0,0 +1,28 @@
import path from 'path'
import { defineConfig } from 'vite'
import tsconfigPaths from 'vite-tsconfig-paths'
import baseLibConfig from './vite.lib.config'
const PWD = process.env.PWD
const pkg = require(path.join(PWD, 'package.json'))
const deps = [...Object.keys(Object.assign({}, pkg.peerDependencies))]
export default defineConfig({
plugins: [tsconfigPaths()],
build: {
...(baseLibConfig.build || {}),
outDir: 'umd',
lib: {
...(baseLibConfig.build?.lib || {}),
fileName: pkg.name.replace(/@nhost\//g, ''),
formats: ['umd']
},
rollupOptions: {
...(baseLibConfig.build?.rollupOptions || {}),
external: (id) => deps.some((dep) => id.startsWith(dep))
}
}
})

View File

@@ -0,0 +1,13 @@
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import baseLibConfig from './vite.lib.config'
export default defineConfig({
...baseLibConfig,
optimizeDeps: {
include: ['react/jsx-runtime']
},
plugins: [react({ jsxRuntime: 'classic' }), ...baseLibConfig.plugins]
})

View File

@@ -0,0 +1,13 @@
import { defineConfig } from 'vite'
import viteReactConfig from './vite.react.config'
export default defineConfig({
...viteReactConfig,
build: {
...viteReactConfig.build,
watch: {
buildDelay: 500
}
}
})

View File

@@ -0,0 +1,30 @@
import path from 'path'
import { defineConfig } from 'vite'
import tsconfigPaths from 'vite-tsconfig-paths'
import react from '@vitejs/plugin-react'
import baseLibConfig from './vite.lib.config'
const PWD = process.env.PWD
const pkg = require(path.join(PWD, 'package.json'))
const deps = [...Object.keys(Object.assign({}, pkg.peerDependencies))]
export default defineConfig({
plugins: [react(), tsconfigPaths()],
build: {
...(baseLibConfig.build || {}),
outDir: 'umd',
lib: {
...(baseLibConfig.build?.lib || {}),
fileName: pkg.name.replace(/@nhost\//g, ''),
formats: ['umd']
},
rollupOptions: {
...(baseLibConfig.build?.rollupOptions || {}),
external: (id) => deps.some((dep) => id.startsWith(dep))
}
}
})

10
config/vite.vue.config.js Normal file
View File

@@ -0,0 +1,10 @@
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import baseLibConfig from './vite.lib.config'
export default defineConfig({
...baseLibConfig,
plugins: [vue(), ...baseLibConfig.plugins]
})

View File

@@ -0,0 +1,13 @@
import { defineConfig } from 'vite'
import viteVueConfig from './vite.vue.config'
export default defineConfig({
...viteVueConfig,
build: {
...viteVueConfig.build,
watch: {
buildDelay: 500
}
}
})

View File

@@ -0,0 +1,30 @@
import path from 'path'
import { defineConfig } from 'vite'
import tsconfigPaths from 'vite-tsconfig-paths'
import vue from '@vitejs/plugin-vue'
import baseLibConfig from './vite.lib.config'
const PWD = process.env.PWD
const pkg = require(path.join(PWD, 'package.json'))
const deps = [...Object.keys(Object.assign({}, pkg.peerDependencies))]
export default defineConfig({
plugins: [vue(), tsconfigPaths()],
build: {
...(baseLibConfig.build || {}),
outDir: 'umd',
lib: {
...(baseLibConfig.build?.lib || {}),
fileName: pkg.name.replace(/@nhost\//g, ''),
formats: ['umd']
},
rollupOptions: {
...(baseLibConfig.build?.rollupOptions || {}),
external: (id) => deps.some((dep) => id.startsWith(dep))
}
}
})

View File

@@ -1,11 +0,0 @@
{
"singleQuote": true,
"printWidth": 80,
"tabWidth": 2,
"useTabs": false,
"trailingComma": "all",
"bracketSpacing": true,
"bracketSameLine": false,
"endOfLine": "auto",
"semi": true
}

27
docs/CHANGELOG.md Normal file
View File

@@ -0,0 +1,27 @@
# @nhost/docs
## 0.0.4
### Patch Changes
- ba785da1: Bump dependencies versions
## 0.0.3
### Patch Changes
- eb46f7d8: Use port 1337 if no port is specified when using "localhost" as `subdomain`.
## 0.0.2
### Patch Changes
- 747aa969: fix: added twitch and discord as provider
## 0.0.1
### Patch Changes
- 584976d: - publishable directory structure changes (ESM, CJS and UMD included in the output)
- build system improvements
- fixed some bundling concerns (https://github.com/nhost/nhost/issues/428)

View File

@@ -1,91 +0,0 @@
---
title: 'Authenticate users'
slug: /get-started/authentication
---
You defined `select` permissions for the `public` role in the previous section. You will now add `insert` and `create` permissions for authenticated users to secure your app's GraphQL API with authentication.
> Nhost's authentication service lets you deliver frictionless registration and login experiences to your users. We support most social providers and different methods such as email & password and passwordless (magic link).
---
## Insert a test user
Manually create a user by going to your app's **Users** tab (top menu) and clicking on **Add User**.
![Add user](/img/quick-start/add-user.gif)
You will now use that newly created user to make authenticated requests to the API.
---
## Authenticate and query data
Add the following code to sign in the new user and request the list of todos again:
```js
import { NhostClient } from '@nhost/nhost-js';
const nhost = new NhostClient({
backendUrl: 'https://[app-subdomain].nhost.run',
})(async () => {
// Sign in user
const signInResponse = await nhost.auth.signIn({
email: 'joe@example.com',
password: 'securepassword',
});
// Handle sign-in error
if (signInResponse.error) {
throw signInResponse.error;
}
// Get todos
const todos = await nhost.graphql.request(`
query {
todos {
id
created_at
name
is_completed
}
}
`);
console.log(JSON.stringify(todos.data, null, 2));
})();
```
Why is the return value `null`? Because when making GraphQL requests as an authenticated user, the `user` role is assumed.
> For authenticated requests, there is always the option to override the default `user` role with any other valid role.
---
## Permissions for users
### Remove permissions for the public role
We won't use the `public` role anymore, so let's remove all permission for that role.
![Remove public permissions from Hasura](/img/quick-start/remove-public-permissions.png)
Now we'll add permissions for the `user` role.
> All logged-in users have the `user` role.
### Insert permission
First, we'll set the **Insert permission**.
A user can only insert `name` because all other columns will be set automatically. More specifically, `user_id` is set to the user's id making the request (`x-hasura-user-id`) and is configured in the `Column presets` section. See the image below.
![User insert permission](/img/quick-start/user-insert-permission.png)
### Select permission
For **Select permission**, set a **custom check** so users can only select todos where `user_id` is the same as their user id. In other words: users are only allowed to select their own todos. See the image below.
![User select permission](/img/quick-start/user-select-permission.png)
Now rerun the app. New todos are inserted, and only todos for the user are fetched and displayed. Your backend is successfully secured!

View File

@@ -1,4 +0,0 @@
{
"label": "CLI",
"position": 8
}

View File

@@ -1,33 +0,0 @@
---
title: 'CLI from Zero to Production'
---
In the previous tutorials, we tested various parts of Nhost, such as:
- Database
- GraphQL API
- Permission
- JavaScript SDK
- Authentication
All changes we did to our database and API happened directly in production of our Nhost app.
It's not ideal for making changes in production because you might break things, which will affect all users of your app.
Instead, it's recommended to make changes and test your app locally before deploying those changes to production.
To do changes locally, we need to have a complete Nhost app running locally, which the Nhost CLI does.
The Nhost CLI matches your production application in a local environment, this way you can make changes and test your code before deploying your changes to production.
## Recommended workflow with Nhost
1. Develop locally using the Nhost CLI.
2. Push changes to GitHub.
3. Nhost automatically applies changes to production.
## What you'll learn in this guide:
- Use the Nhost CLI to create a local environment
- Connect a GitHub repository with a Nhost app
- Deploy local changes to production

View File

@@ -1,37 +0,0 @@
---
title: 'Install the CLI'
---
Install the Nhost CLI using the following command:
```bash
sudo curl -L https://raw.githubusercontent.com/nhost/cli/main/get.sh | bash
```
Initialize a new Nhost App locally:
```bash
nhost init -n "nhost-example-app" && cd nhost-example-app
```
And initialize the GitHub repository in the same folder:
```bash
echo "# nhost-example-app" >> README.md
git init
git add README.md
git commit -m "first commit"
git branch -M main
git remote add origin https://github.com/[github-username]/nhost-example-app.git
git push -u origin main
```
Now go back to the **Nhost Console** and click **Deployments**. You just made a new deployment to your Nhost app!
![Deployments tab](/img/cli-workflow/deployments-tab.png)
If you click on the deployment you can see that nothing was really deployed. Thats because we just made a change to the README file.
![Deployments details](/img/cli-workflow/deployments-details.png)
Let's do some local backend changes!

View File

@@ -1,81 +0,0 @@
---
title: 'Local changes'
---
Start Nhost locally:
```bash
nhost dev
```
:::tip
Make sure you have [Docker](https://www.docker.com/get-started) installed on your computer. Its required for Nhost to work.
:::
The `nhost dev` command will automatically start a complete Nhost environment locally on your computer using:
- Postgres
- Hasura
- Authentication
- Storage
- Serverless Functions
- Mailhog
You use this local environment to do changes and testing before you deploy your changes to production.
Running `nhost dev` also starts the Hasura Console.
:::tip
It's important that you use the Hasura Console that is started automatically when you do changes. This way, changes are automatically tracked for you.
:::
![Hasura Console](/img/cli-workflow/hasura-console.png)
In the Hasura Console, create a new table `customers` with two columns:
- id
- name
<video
src="/videos/cli-workflow/hasura-create-customers-table.mp4"
width="100%"
controls
/>
When we created the `customers` table there was also a migration created automatically. The migration was created at under `nhost/migrations/default`.
```bash
$ ls -la nhost/migrations/default
total 0
drwxr-xr-x 3 eli staff 96 Feb 7 16:19 .
drwxr-xr-x 3 eli staff 96 Feb 7 16:19 ..
drwxr-xr-x 4 eli staff 128 Feb 7 16:19 1644247179684_create_table_public_customers
```
This database migration has only been applied locally, meaning, you created the `customers` table locally but it does not (yet) exists in production.
To apply the local change to production we need to commit the changes and push it to GitHub. Nhost will then automatically pick up the change in the repository and apply the changes.
:::tip
You can commit and push files in another terminal while still having `nhost dev` running.
:::
```bash
git add -A
git commit -m "Initialized Nhost and added a customers table"
git push
```
Head over to the **Deployments** tab in the **Nhost console** to see the deployment.
![Deployments tab after changes](/img/cli-workflow/deployments-tab-with-changes.png)
Once the deployment finishes the `customers` table is created in production.
![Customers table in Hasura Console](/img/cli-workflow/hasura-customers-table.png)
We've now completed the recommended workflow with Nhost:
1. Develop locally using the Nhost CLI.
2. Push changes to GitHub.
3. Nhost deploys changes to production.

View File

@@ -1,170 +0,0 @@
---
title: 'Metadata and Serverless Functions'
---
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
In the previous section, we only created a new table; `customers`. Using the CLI you can also do changes to other parts of your backend.
There are three things the CLI and the GitHub integration track and applies to production:
1. Database migrations
2. Hasura Metadata
3. Serverless Functions
For this section, let's do one change to the Hasura metadata and create one serverless function
### Hasura Metadata
We'll add permissions to the `users` table, making sure users can only see their own data. For this, go to the `auth` schema and click on the `users` table. then click on **Permissions** and enter a new role **user** and create a new **select** permission for that role**.**
Create the permission **with custom check**:
```json
{
"id": {
"_eq": "X-Hasura-User-Id"
}
}
```
Select the following columns:
- id
- created_at
- display_name
- avatar_url
- email
Then click **Save permissions**.
<video
src="/videos/cli-workflow/hasura-user-permissions.mp4"
width="100%"
controls
/>
Now, let's do a `git status` again to confirm the permission changes we did was tracked locally in your git repository.
![Git status](/img/cli-workflow/git-status.png)
We can now commit this change:
```bash
git add -A
git commit -m "added permission for uses"
```
Now let's create a serverless function before we push all changes to GitHub so Nhost can deploy our changes.
### Serverless Function
A serverless function is a pieces of code written in JavaScript or TypeScript that take an HTTP request and returns a response.
Here's an example:
```bash
import { Request, Response } from 'express'
export default (req: Request, res: Response) => {
res.status(200).send(`Hello ${req.query.name}!`)
}
```
Serverless functions are placed in the `functions/` folder of your repository. Every file will become its own endpoint.
Before we create our serverless function we'll install `express`, which is a requirement for serverless functions to work.
<Tabs>
<TabItem value="npm" label="npm" default>
```bash
npm install express
npm install -d @types/node @types/express
```
</TabItem>
<TabItem value="yarn" label="Yarn">
```bash
yarn add express
yarn add -D @types/node @types/express
```
</TabItem>
</Tabs>
Then we'll create a file `functions/time.ts`
In the file `time.ts` we'll add the following code to create our serverless function:
```bash
import { Request, Response } from 'express';
export default (req: Request, res: Response) => {
return res
.status(200)
.send(`Hello ${req.query.name}! It's now: ${new Date().toUTCString()}`);
};
```
We can now test the function locally. Locally, the backend URL is `http://localhost:1337`. Functions are under `/v1/functions`. And every function's path and filename becomes an API endpoint.
This means our function `functions/time.ts` is at `http://localhost:1337/v1/functions/time`.
Let's use curl to test our new function:
```bash
curl http://localhost:1337/v1/functions/time
Hello undefined! It's now: Sun, 06 Feb 2022 17:44:45 GMT
```
And with a query parameter with our name:
```bash
curl http://localhost:1337/v1/functions/time\?name\=Johan
Hello Johan! It's now: Sun, 06 Feb 2022 17:44:48 GMT
```
Again, let's use `git status` to see the changes we did to create our serverless function.
Now let's commit the changes and push them to GitHub.
```bash
git add -A
git commit -m "added serverless function"
git push
```
In the Nhost Console, click on the new deployment to see details.
![Deployments details for function](/img/cli-workflow/details-for-function.png)
After Nhost has finished deploying your changes we can test them in production. First let's confirm that the user permissions are applied.
![Hasura Console permissions table](/img/cli-workflow/hasura-permissions-table.png)
Then, let's confirm that the serverless function was deployed. Again, we'll use curl:
```bash
curl https://your-backend-url.nhost.run/v1/functions/time\?name\=Johan
```
![Serverless Function test](/img/cli-workflow/function-test.png)
## Conclusion
In this tutorial we have installed the Nhost CLI and created a local Nhost environment to do local development and testing.
In the local environment we've made changes to our database, to Hasura's metadata and created a serverless function.
We've connected a GitHub repository and pushed our changes to GitHub.
We've seen Nhost automatically deploying our changes and we've verified that the changes were applied.
In summary, we've set up a productive environment using the recommended Nhost workflow:
1. Develop locally using the Nhost CLI.
2. Push changes to GitHub.
3. Nhost deploys changes to production.

View File

@@ -1,31 +0,0 @@
---
title: 'Workflow setup'
---
What follows is a detailed tutorial on how you setup Nhost for this workflow
### Create Nhost App
Create a **new Nhost app** for this tutorial.
:::tip
It's important that you create a **new** Nhost app for this guide instead of reusing an old Nhost app because we want to start with a clean Nhost app.
:::
![Create new app](/img/cli-workflow/create-app.png)
### Create new GitHub Repository
Create a new GitHub repository for your new Nhost app. The repo can be either private or public.
![Create new repo](/img/cli-workflow/create-repo.png)
## Connect GitHub Repository to Nhost App
In the Nhost Console, go to the dashboard of your Nhost app and click **Connect to GitHub**.
<video
src="/videos/cli-workflow/connect-github-repo.mp4"
width="100%"
controls
/>

View File

@@ -1,36 +0,0 @@
---
title: 'Welcome to Nhost'
sidebar_position: 1
---
Nhost is an open-source, real-time, server-less backend platform for building reliable apps that scale with your business.
---
## Components
Nhost uses an opinionated set of open-source components.
#### Database
Your application gets its own PostgreSQL database, the world's most advanced relational database.
#### GraphQL API
Highly performant and real-time GraphQL API with Hasura.
#### Authentication and storage
User management & file storage seamlessly integrated with Hasura permissions.
#### Serverless functions
JavaScript and TypeScript functions run your custom code in the backend.
---
## Get started
Follow our [Quick start](/get-started/quick-start) guide to build your first app.
Check out [Nhost on GitHub](https://github.com/nhost/nhost). Give us a star, and feel free to open a discussion for any feature requests as well.

View File

@@ -1,36 +0,0 @@
---
title: 'Create your app'
sidebar_position: 1
---
Let's create a simple todo-app using Nhost. In a todo-app, a user should be able to create list items for their account (CRUD) and not have anyone else see them (permissions).
To implement this todo-app with Nhost, we'll briefly cover these topics:
- Creating a new app on Nhost
- Defining a database schema
- Inserting data
- Setting permissions
- Querying data via the GraphQL API
By the end of this quick-start, you will better understand what Nhost is and what it does for you.
---
## Log in to Nhost
Go to [app.nhost.io](https://app.nhost.io) and sign up for a new account if you don't have one already.
---
## Create app
Press the **"New App"** button on the console's home page. Choose a name and pick the region closest to your users.
You'll be all set with the Default Workspace and the Free plan for now.
![New App](/img/quick-start/new-app.png)
Creating a new app takes around 20 seconds or so. During this time, Nhost sets up your app's entire backend and infrastructure.
Once the setup completes, you'll automatically see the app dashboard, and you're ready to define your app's database schema.

View File

@@ -1,110 +0,0 @@
---
title: 'JavaScript client'
---
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
In the previous section, you used the Hasura Console to fetch a list of todos. Now, you will write a small JavaScript client to interact and retrieve todos from your Nhost app.
### Frontend frameworks
Nhost is framework-agnostic and works with any frontend you might build. You can also connect to Nhost from your server-side if you wish.
In this guide, we'll keep the example simple. We're not using a frontend framework. In a real-life scenario, you'd probably build a frontend client with a framework such as React, Vue, Svelte or React Native.
---
## Setup
:::info
Make sure you have [Node.js](https://nodejs.org) and [npm](https://docs.npmjs.com/getting-started) or [Yarn](https://classic.yarnpkg.com/lang/en/docs/install) installed.
:::
Create a new folder called `nhost-todos`, initialize a new JavaScript app there, and install the Nhost JavaScript SDK:
<Tabs>
<TabItem value="npm" label="npm" default>
```bash
npm init -y
yarn add @nhost/nhost-js graphql
```
</TabItem>
<TabItem value="yarn" label="Yarn">
```bash
yarn init -y
npm install @nhost/nhost-js graphql
```
</TabItem>
</Tabs>
:::caution attention
You might have to edit the `package.json` file and add/change the `type` object to `module` (`"type": "module"`).
:::
---
## Initialize Nhost
In the new directory, create a file called `index.js`.
Enter the following code into this file. It will initialize a new `NhostClient` that will interact with your backend:
```js
import { NhostClient } from '@nhost/nhost-js';
const nhost = new NhostClient({
backendUrl: 'https://[app-subdomain].nhost.run', // replace this with the backend URL of your app
});
console.log(nhost.graphql.getUrl());
```
Run the code in your terminal. You should see your app's GraphQL endpoint URL:
```bash
➜ node index.js
https://[app-subdomain].nhost.run/v1/graphql
```
### Query todos
If you now add the following GraphQL query to the client, let's see what happens when you run the updated version:
```js
import { NhostClient } from '@nhost/nhost-js';
const nhost = new NhostClient({
backendUrl: 'https://[app-subdomain].nhost.run',
})(async () => {
// nhost.graphql.request returns a promise, so we use await here
const todos = await nhost.graphql.request(`
query {
todos {
id
created_at
name
is_completed
}
}
`);
// Print todos to console
console.log(JSON.stringify(todos.data, null, 2));
})();
```
```bash
➜ node index.js
null
```
`null` is printed. Why is that? Let's find out.

View File

@@ -1,53 +0,0 @@
---
title: 'Set permissions'
---
While using the Hasura Console, you could fetch the todos because the **admin** role is enabled by default but when building your applications with a client, you want to define permissions using **roles** that your users can assume when making requests.
Hasura supports role-based access control. You create rules for each role, table, and operation (select, insert, update and delete) that can check dynamic session variables, like user ID.
## Unauthenticated users
Use the `public` role in permissions when you want some data to be accessed by anyone without being signed in. The `public` role is the default role in all unauthenticated requests.
Generally speaking, the `public` role should not have insert, update or delete permissions defined.
### Setting `public` permissions
In Hasura Console, go to the **Data** tab, click on the **todos** table, then click **Permissions**. Add a new role called `public` and click on **select**. The permission options for the select operation show up below.
Add the following permissions:
![Public role](/img/quick-start/permissions-public-select.png)
Rerun the program. Now you see all todos.
```bash
➜ node index.js
{
"todos": [
{
"id": "558b9754-bb18-4abd-83d9-e9056934e812",
"created_at": "2021-12-01T17:05:09.311362+00:00",
"name": "write docs",
"is_completed": false
},
{
"id": "480369c8-6f57-4061-bfdf-9ead647e10d3",
"created_at": "2021-12-01T17:05:20.5693+00:00",
"name": "cook dinner",
"is_completed": true
}
]
}
```
---
There are two reasons why the request succeeded:
1. Nhost sets the `public` role for every unauthenticated GraphQL request.
2. You explicitly defined permissions for the `public` role.
It is essential to understand that Hasura has an **allow nothing by default** policy to ensure that only roles and permissions you define explicitly have access to the GraphQL API.

View File

@@ -1,93 +0,0 @@
---
title: 'Define schema'
---
To implement an app for managing a todo list, let's ensure we have database tables for storing todos and users.
---
## Open Hasura Console
Hasura generates real-time GraphQL APIs, but it also provides a web console for manipulating the schema and data of your database.
Go to the **Data** tab on your app's dashboard and select **Open Hasura**. Remember to copy the admin secret.
The Hasura Console of your app's dedicated Hasura instance will open in a new tab. You can use Hasura Console to manage your app's schema, data, permissions, and event triggers.
![Data -> Open Hasura](/img/quick-start/data-tab.png)
---
## Users table
You should see all your database tables on the left-hand side of the screen. You should see multiple different **schemas** displayed as folders:
- `public` schema for your app's custom tables
- `auth` and `storage` schemas for Nhost's user management and file storage
If you open the `auth` schema, you'll see that your app already has a `users` table, so you don't have to create one.
![To store the users, we already have a users table from the auth schema](/img/quick-start/list-of-schemas.png)
---
## Create todos table
In Hasura Console, go to the **data** tab, then click **Create Table**. Name this table `todos`.
### Add frequently used columns
`id` and `created_at` columns are standard and can be added with two clicks. Click **Frequently used columns** and create them:
- `id` (UUID)
- `created_at` (timestamp)
Using frequently used columns ensures the columns get the right name, type, and default value.
![Frequently used columns in the Hasura console](/img/quick-start/frequently-used-columns.png)
### Add custom columns
Add two more columns manually:
- `name` (text)
- `is_completed` (boolean)
Make sure to set the default value of `is_completed` to `false`.
![Create a table in the Hasura console](/img/quick-start/create-table.png)
This is all we need! A new table will be created when you click **Add Table**.
---
## Insert data
Go to the **Insert Row** tab to add some data to your database.
![Inserting todos](/img/quick-start/insert-todos.gif)
---
## Query data
Now that we have data in our database, we can retrieve it via a GraphQL API. Go to the **API** tab in the main menu. You can use this view to make GraphQL requests that query or mutate data in your database.
Paste the following GraphQL query into the form and press the "play" button:
```graphql
query {
todos {
id
created_at
name
is_completed
}
}
```
You should see the todos you just inserted show up as output on the right-hand side.
### Admin role
All requests in the Hasura Console use the `admin` role by default. This role has access to all tables and permissions.

View File

@@ -1,104 +0,0 @@
---
title: 'Upgrade from v1 to v2'
---
Upgrading from Nhost v1 to v2 requires database schema and Hasura metadata changes.
---
## Upgrade Steps
### Create a new Nhost v2 app locally
:::tip
Make sure you have the [Nhost CLI](/reference/cli) installed
:::
```bash
nhost init my-nhost-v2-app
cd my-nhost-v2-app
```
### Update config
Update `version: 3` to `version: 2` in `nhost/config.yaml`. This will update Hasura's configuration version, and we need to downgrade the version when we export migrations and metadata.
### Export current migrations and metadata from Nhost v1
Inside the `nhost/` folder of your app, run:
```bash
hasura migrate create init --from-server --endpoint=[v1-endpoint] --admin-secret=[v1-admin-secret]
hasura metadata export --endpoint=[v1-endpoint] --admin-secret=[v1-admin-secret]
```
### Update Migrations
Make the following changes manually to your migrations.
:::tip
The migration file is located at `nhost/migrations/[timestamp]/up.sql`.
:::
- Add `OR REPLACE` after `CREATE` for the `public.set_current_timestamp_updated_at` function
- Delete all `auth.*` tables and functions (if any).
- Delete `public.users` table and everything related to the table such as constraints, triggers, etc.
- Update FK references from `public.users` to `auth.users` (if any).
### Update Metadata
Make the following changes manually to your metadata.
:::tip
The metadata is located at `nhost/metadata/tables.yaml`.
:::
- Delete tracking all tables in the `auth` schema.
- Delete tracking the `public.users` table.
- Update all references to `users` from the `public` to `auth` schema.
### Start nhost
Start Nhost locally using the [CLI](/reference/cli). From the root of your app, run:
```bash
nhost -d
```
:::tip
Running Nhost applies your local database migrations and Hasura metadata.
:::
### Restart Auth and Storage containers
Open Docker UI and restart Hasura Auth and Hasura Storage. Restarting those containers applies new metadata, effectively tracking everything in the `auth` and the `storage` schema.
### Delete migrations and metadata
Delete the local migrations and metadata.
```bash
rm -rf nhost/migrations nhost/metadata
```
### Update config (again)
Update `config: 2` to `config: 3` in `nhost/config.yaml`.
### Pull migrations and metadata from our local instance
In the `nhost/` folder, run the following command:
```bash
hasura migrate create init --from-server --endpoint=http://localhost:[hasura-port] --admin-secret=nhost-admin-secret
hasura metadata export --endpoint=http://localhost:[hasura-port] --admin-secret=nhost-admin-secret
```
:::warning
You cannot use port `1337` in the commands above. You have to use the specific port Hasura uses. Go to the Hasura Console under API and look for the port Hasura is using under GraphQL Endpoint.
:::
### Done
You now have a Nhost v2 project locally with correct migrations and metadata. Happy hacking!

View File

@@ -1,35 +0,0 @@
---
title: 'Welcome to Nhost'
---
Nhost is an open-source, real-time, server-less backend platform for building reliable apps that scale with your business.
---
## Components
Nhost uses an opinionated set of open-source components.
#### Database
Your application gets its own PostgreSQL database, the world's most advanced relational database.
#### GraphQL API
Highly performant and real-time GraphQL API with Hasura.
#### Authentication and storage
User management & file storage seamlessly integrated with Hasura permissions.
#### Serverless functions
JavaScript and TypeScript functions run your custom code in the backend.
---
## Get started
Follow our [Quick start](/get-started/quick-start) guide to build your first app.
Check out [Nhost on GitHub](https://github.com/nhost/nhost). Give us a star, and feel free to open a discussion for any feature requests as well.

31
docs/docs/index.mdx Normal file
View File

@@ -0,0 +1,31 @@
---
title: 'Introduction to Nhost'
sidebar_label: Introduction
sidebar_position: 1
image: /img/og/platform/introduction-to-nhost.png
---
Nhost is the open source GraphQL backend (Firebase Alternative) and a development platform. Nhost is doing for the backend, what [Netlify](https://netlify.com/) and [Vercel](https://vercel.com/) are doing for the frontend.
We provide a modern backend with the general building blocks required to build fantastic digital products.
We make it easy to build and deploy this backend using our platform that takes care of configuration, security, and performance. Things just works and scale automatically so you can focus on your product and on your business.
## Quickstart
Get started quickly by following one of our quickstart guides:
- [Next.js](/platform/quickstarts/nextjs)
- [React](/platform/quickstarts/react)
- [RedwoodJS](/platform/quickstarts/redwoodjs)
- [Vue](/platform/quickstarts/vue)
## Products and features
Learn more about the product and features of Nhost.
- [Database](/platform/database)
- [GraphQL](/platform/graphql)
- [Authentication](/platform/authentication)
- [Storage](/platform/storage)
- [Serverless Functions](/platform/serverless-functions)

View File

@@ -1,5 +0,0 @@
{
"label": "The Nhost Platform",
"position": 1,
"link": { "type": "generated-index", "slug": "/platform" }
}

View File

@@ -1,5 +1,4 @@
{
"label": "Authentication",
"position": 4,
"link": { "id": "platform/authentication/index", "type": "doc" }
"position": 6
}

View File

@@ -1,93 +1,108 @@
---
title: 'Email templates'
title: 'Email Templates'
sidebar_position: 4
---
The following emails can be sent as part of the authentication flow:
Nhost Auth sends out transactional emails as part of the authentication service. These emails can be modified using email templates.
- Sign up confirmation email (when using email + password)
- Reset password email (when using email + password)
- Passwordless login email (when using Magic Link)
- Confirm email change (any sign-up method)
The following email templates are available:
---
- **email-verify** - Verify email address
- **email-confirm-change** - Confirm email change to a new email address.
- **signin-passwordless** - Magic Link
- **password-reset** - Reset password
## Enabling custom email templates
Changing email templates is only available for projects on the [Pro and Enterprise plan](https://nhost.io/pricing).
If you have developed custom email templates, you must make them available over HTTP and then point Nhost to them. You can host the templates on your server, or use a public repository on GitHub.
## Update Email Templates
Go to **Users -> Login settings** and scroll down to **Custom email templates**, and set the URL to where your templates are located:
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](/img/platform/email-templates.svg)
Email templates are automatically deployed during a deployment, just like database migrations, Hasura metadata, and Serverless Functions.
You only need to define the base URL to point to your hosted templates. The UI will give you a hint about where Nhost will look for your actual template files.
## File Structure
---
Emails are located in the `nhost/` folder like this:
## File structure
The email templates should be provided as body.html and subject.txt files in this predefined folder structure.
The email templates should be provided as body.html and subject.txt files in this predefined folder structure:
**Example:** Email templates for `en` (English) and `es` (Spanish):
```txt
// At base URL (e.g. https://yourapp.com/email-templates/)
en/
email-confirm-change/
body.html
subject.txt
email-verify/
body.html
subject.txt
password-reset/
body.html
subject.txt
signin-passwordless/
body.html
subject.txt
// Other language versions
fr/
/* ... */
se/
/* ... */
my-nhost-project/
└── nhost/
├── config.yaml
├── emails/
│ ├── en/
│ │ ├── email-verify/
│ │ │ ├── subject.txt
│ │ │ └── body.html
│ │ ├── email-confirm-change/
│ │ │ ├── subject.txt
│ │ │ └── body.html
│ │ ├── signin-passwordless/
│ │ │ ├── subject.txt
│ │ │ └── body.html
│ │ └── password-reset/
│ │ ├── subject.txt
│ │ └── body.html
│ └── es/
│ ├── email-verify/
│ │ ├── subject.txt
│ │ └── body.html
│ ├── email-confirm-change/
│ │ ├── subject.txt
│ │ └── body.html
│ ├── signin-passwordless/
│ │ ├── subject.txt
│ │ └── body.html
│ └── password-reset/
│ ├── subject.txt
│ └── body.html
├── migrations/
├── metadata/
└── seeds
```
You dont have to provide all templates - only the one you wish to use and customize. For the templates you do provide, you must provide both body.html and subject.txt.
As you see, the format is:
[View example on GitHub](https://github.com/nhost/nhost/tree/main/examples/custom-email-templates)
---
## Localisation
If Nhost finds a template that matches the recipent users locale, the email will be sent in that language. Use two-letter language codes to set the locale.
English will always be used as the default if another language version is not found.
---
## Template variables
Use variables like `${displayName}` to make your templates more dynamic:
```html
<!-- https://yourapp.com/email-templates/en/email-verify/body.html -->
<h2>Confirm Email Change</h2>
<p>Hi, ${displayName}! Please click this link to verify your email:</p>
<p>
<a href="${displayName}">Verify new email</a>
</p>
```
nhost/emails/{two-letter-language-code}/{email-template}/[subject.txt, body.html]
```
These variables can be used either in the template subject or body. The following variables are supported:
Default templates for English (`en`) and French (`fr`) are automatically generated when the project is initialized with the [CLI](/platform/cli).
## Languages
The user's language is what decides what template to send. The user's language is stored in the `auth.users` table in the `locale` column. This `locale` column contains a two-letter language code in [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) format.
This value is `en` by default for new users.
## Variables
The following variables are available to use in the email templates:
| Variable | Description |
| ----------- | ---------------------------------------------------------------------------------------------------------------------------------- |
| link | The full URL to the target of the transaction. This should be used in the main call to action. This is available in all templates. |
| serverUrl | URL of the authentication server |
| clientUrl | URL to your frontend app |
| redirectTo | URL where the user will be redirected to after clicking the link and finishing the action of the email |
| ticket | Ticket that is used to authorize the link request |
| displayName | The display name of the user. |
| email | The email of the user. |
| locale | Locale of the user as a two-letter language code. E.g. "en". |
---
Use variables like this: `${displayName}` in the email templates.
<!-- ## Developing emails templates locally -->
**Example:** A email template to verify users' emails:
```html title="nhost/emails/en/email-verify/body.html"
<h2>Verify You Email</h2>
<p>Hi, ${displayName}! Please click the link to verify your email:</p>
<p>
<a href="${link}">Verify Email</a>
</p>
```

View File

@@ -1,75 +1,32 @@
---
title: Authentication
title: Nhost Authentication
sidebar_label: Authentication
sidebar_position: 1
image: /img/og/platform/authentication.png
---
# Authentication
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 provides a ready-to-use authentication service, integrated with Nhost JavaScript SDK. This makes it easy to build login flows with multiple sign-in methods.
Nhost Authentication lets you authenticate users using different sign-in methods:
## Getting Started
Sign up a user with the [Nhost JavaScript SDK](/reference/sdk):
```js
import { NhostClient } from '@nhost/nhost-js';
const nhost = new NhostClient({
backendUrl: 'https://[app-subdomain].nhost.run',
});
await nhost.auth.signUp({
email: 'joe@nhost.io',
password: 'secret-password',
});
```
- [Email and Password](/platform/authentication/sign-in-with-email-and-password)
- [Magic Link](/platform/authentication/sign-in-with-magic-link)
- [Phone Number (SMS)](/platform/authentication/sign-in-with-phone-number-sms)
- [Security Keys (WebAuthn)](/platform/authentication/sign-in-with-phone-number-sms)
- [Apple](/platform/authentication/sign-in-with-apple)
- [Discord](/platform/authentication/sign-in-with-discord)
- [Facebook](/platform/authentication/sign-in-with-facebook)
- [GitHub](/platform/authentication/sign-in-with-github)
- [Google](/platform/authentication/sign-in-with-google)
- [LinkedIn](/platform/authentication/sign-in-with-linkedin)
- [Spotify](/platform/authentication/sign-in-with-spotify)
- [Twitch](/platform/authentication/sign-in-with-twitch)
## How it works
1. A user signs up and the user information is added to the `auth.users` table.
2. Nhost returns an [access token](#access-tokens) (JWT token) and the user's information.
3. The user sends a request to the GraphQL API together with the access token.
4. The GraphQL API reviews the access token to ensure the user is authorized to send the request.
1. When a user signs up or is created, the user's information is inserted into the `auth.users` table in your database.
2. Nhost returns an access token and a refresh token, together with the user's information.
3. The user sends requests to Nhost services (GraphQL API, Authentication, Storage, Functions) with the access token as a header.
4. The Nhost services use the user's access token to authorize the requests.
Nhost's authentication service is integrated with your database. All users are stored in the app's database under the `auth` schema and can be accessed using GraphQL:
```graphql
query {
users {
id
displayName
avatarUrl
email
}
}
```
## Tokens
Nhost authentication uses two tokens: Access tokens and refresh tokens.
[Nhost JavaScript SDK](/reference/sdk) automatically handles access and refresh tokens.
### Access tokens
An access token is used to authenticate and authorize a user when doing a GraphQL request.
Access tokens are cryptographically signed and cannot be revoked. They are only valid for 15 minutes. Users can request a new valid access token with a refresh token.
An access token includes a user's ID and roles. Here's an example:
```json
{
"https://hasura.io/jwt/claims": {
"x-hasura-user-id": "c8ee8353-b886-4530-9089-631ea7fd4c8a",
"x-hasura-default-role": "user",
"x-hasura-allowed-roles": ["user", "me"]
},
"iat": 1595146465,
"exp": 1595147365
}
```
### Refresh tokens
A refresh token is used to request a new access token. Refresh tokens are long-lived tokens stored in the database.
Nhost's authentication service is integrated with your database. All users are stored in the `users` table under the `auth` schema.

View File

@@ -1,4 +0,0 @@
{
"label": "OAuth providers",
"position": 3
}

View File

@@ -1,48 +0,0 @@
---
title: 'OAuth Providers'
slug: /platform/authentication/social-sign-in
---
Nhost Auth supports the following social sign-in providers:
- [Google](/platform/authentication/sign-in-with-google)
- [Facebook](/platform/authentication/sign-in-with-facebook)
- [GitHub](/platform/authentication/sign-in-with-github)
- [LinkedIn](/platform/authentication/sign-in-with-linkedin)
- [Spotify](/platform/authentication/sign-in-with-spotify)
---
## Enabling Social Sign-In Provider
To start with social sign-in, select your app in Nhost Console and go to **Users****Login settings**.
You need to set client ID and client secret for each provider that you want to enable.
---
## Implementing sign-in experience
Use the [Nhost JavaScript SDK](/reference/sdk) and the `signIn()` method to implement social sign-in in your app,
Here's an example of how to implement sign-in with GitHub:
```js
nhost.auth.signIn({
provider: 'github',
});
```
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****Login settings****Client URL**.
---
## 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 for each user. Editing scope is not currently supported.
## Provider OAuth Tokens
Nhost saves both access and refresh tokens for each user and provider in the `auth.user_providers` table. These tokens can be used to interact with the provider if needed.

View File

@@ -1,86 +0,0 @@
---
title: 'Sign-in methods'
sidebar_position: 2
---
Nhost supports a variety of sign-in methods:
---
## Email + password
To sign in a user with email and password, the user must first sign up:
```js
await nhost.auth.signUp({
email: 'joe@nhost.io',
password: 'secret-password',
});
```
If you've turned on email verification in your app's **login settings**, a user will be sent a verification email upon signup. The user must click the verification link in the email before they can log in.
Once a user has been signed up (and optionally verified), you can sign them in:
```js
await nhost.auth.signIn({
email: 'joe@nhost.io',
password: 'secret-password',
});
```
---
## Passwordless email (magic link)
Users can sign in with passwordless email, also called magic link.
When a user signs in with passwordless email, Nhost will create the user if they don't already exist and send an email to the user.
When a user clicks the link in the email, they will be redirected to your app and automatically signed in.
Example in JavaScript:
```js
await nhost.auth.signIn({
email: 'joe@nhost.io',
});
```
---
## Passwordless SMS
Users can sign in with passwordless SMS. The passwordless SMS sign in method has a flow:
First, "sign in" the user with a phone number.
```js
await nnhost.auth.signIn({
phoneNumber: '+467610337135',
});
```
This will create the user if the user does not already exist, and send a One Time Password (OTP) to the user's
phone number.
Use the OTP to finalize the sign-in:
```js
await nhost.auth.signIn({
phoneNumber: '+467610337135',
otp: 'otp-from-sms',
});
```
---
## Anonymous
A user can be created anonymously. This is useful for offering a limited version of your application to your users without having them sign in first.
An anonymous user gets a user ID with the `anonymous` role. This role can be used to [set permissions in Hasura](/platform/graphql/permissions).
### Deanonymize users
Anonymous users can be converted to "normal" users by deanonymize the user.

View File

@@ -0,0 +1,44 @@
---
title: Sign In with Email and Password
sidebar_label: Email and Password
slug: /platform/authentication/sign-in-with-email-and-password
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 projects.
## Sign Up
Users must first sign up to be able to sign in with Email and Password.
**Example:** Sign up users using the [Nhost JavaScript client](/reference/javascript).
```js
await nhost.auth.signUp({
email: 'joe@example.com',
password: 'secret-password'
})
```
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
Once a user has been signed up (and optionally verified), you can sign them in.
**Example:** Sign in users using the [Nhost JavaScript client](/reference/javascript).
```js
await nhost.auth.signIn({
email: 'joe@example.com',
password: 'secret-password'
})
```
## Verified Emails
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 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

@@ -0,0 +1,33 @@
---
title: Sign In with Magic Link
sidebar_label: Magic Link
slug: /platform/authentication/sign-in-with-magic-link
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 using an email address, without requiring a password.
## Setup
Enable the Magic Link sign-in method in the Nhost dashboard under **Users** -> **Authentication Settings** -> **Magic Link**.
![Magic Link Setup with Nhost](/img/platform/authentication/sign-in-methods/magic-link/magic-link-setup.png)
## Sign In
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.
Use the [Nhost JavaScript client](/reference/javascript) to sign in users with Magic Link:
```js
nhost.auth.signIn({
email: 'joe@example.com'
})
```
If you want to change the email for your magic link emails, you can do so by changing the [email templates](/platform/authentication/email-templates).

View File

@@ -0,0 +1,57 @@
---
title: Sign In with Phone Number (SMS)
sidebar_label: Phone Number (SMS)
slug: /platform/authentication/sign-in-with-phone-number-sms
image: /img/og/platform/sign-in-with-phone-number-sms.png
---
Follow this guide to sign in users with a phone number (SMS).
## Setup
You need a [Twilio account](https://www.twilio.com/try-twilio) to use this feature because all SMS are sent through Twilio.
Enable the Phone Number (SMS) sign-in method in the Nhost dashboard under **Users** -> **Authentication Settings** -> **Passwordless SMS**.
You need to insert the following settings in the Nhost dashboard from Twilio:
- Account SID
- Auth Token
- Messaging Service SID (or a Twilio phone number)
<video width="99%" autoPlay muted loop controls="true" style={{ marginBottom: '15px' }}>
<source src="/videos/enable-sms-sign-in.mp4" type="video/mp4" />
</video>
## Sign In
To sign in users with a phone number is a two-step process:
1. Send a one-time password (OTP) to the user's phone number.
2. The user uses the OTP to sign in.
```js
// Step 1: Send OTP to the user's phone number
await nhost.auth.signIn({
phoneNumber: '+11233213123'
})
// Step 2: Sign in user using their phone number and OTP
await nhost.auth.signIn({
phoneNumber: '+11233213123'
// highlight-next-line
otp: '123456',
})
```
The first time a user signs in using a phone number, the user is created. That means you don't need to sign up the user before signin in the user.
:::info
Phone numbers should start with `+` (not `00`) to follow the [E.164 formatting standard](https://en.wikipedia.org/wiki/E.164).
:::
## Other SMS Providers
We only support Twilio for now. If you want support for another SMS provider, please create an issue on [GitHub](https://github.com/nhost/nhost).

View File

@@ -0,0 +1,107 @@
---
title: Sign In with Security Keys
sidebar_label: Security Keys
slug: /platform/authentication/sign-in-with-security-keys
---
Follow this guide to sign in users with security keys and the WebAuthn API.
Examples of security keys:
- [Windows Hello](https://support.microsoft.com/en-us/windows/learn-about-windows-hello-and-set-it-up-dae28983-8242-bb2a-d3d1-87c9d265a5f0)
- [Apple Touch ID](https://support.apple.com/en-us/HT201371)
- [Apple Face ID](https://support.apple.com/en-us/HT208109)
- [Yubico security keys](https://www.yubico.com/)
- Android Fingerprint sensors
You can read more about this feature in our [blog post](https://nhost.io/blog/webauthn-sign-in-method)
## Setup
Enable the Security Key sign-in method in the Nhost dashboard under **Users** -> **Authentication Settings** -> **Security Keys**.
You need to make sure you also set a valid client URL under **Users** -> **Authentication Settings** -> **Client URL**.
<video width="99%" autoPlay muted loop controls="true" style={{ marginBottom: '15px' }}>
<source src="/videos/enable-security-keys-sign-in.mp4" type="video/mp4" />
</video>
## Sign Up
Signing up with a security key uses the same method as signing up with an email and a password. Instead of a `password` parameter, you need to set the `securityKey` parameter to `true`:
```tsx
const { error, session } = await nhost.auth.signUp({
email: 'joe@example.com',
securityKey: true
})
if (error) {
// Something unexpected happened, for instance, the user canceled their registration
console.log(error)
} else if (session) {
// Sign up is complete!
console.log(session.user)
} else {
console.log(
'You need to verify your email address by clicking the link in the email we sent you.'
)
}
```
## Sign In
Once a user added a security key, they can use it to sign in:
```tsx
const { error, session } = await nhost.auth.signIn({
email,
securityKey: true
})
if (session) {
// User is signed in
} else {
// Something unexpected happened
console.log(error)
}
```
## Add a Security Key
Any signed-in user with a valid email can add a security key when the feature is enabled. For instance, someone who signed up with an email and a password can add a security key and thus use it for their later sign-in!
Users can use multiple devices to sign in to their account. They can add as many security keys as they like.
```tsx
const { key, error } = await nhost.auth.addSecurityKey()
if (key) {
// Successfully added a new security key
console.log(key.id)
} else {
// Somethine unexpected happened
console.log(error)
}
```
A nickname can be added for each security key to make them easy to identify:
```tsx
await nhost.auth.addSecurityKey('my macbook')
```
## List or Remove Security Keys
To list and to remove security keys can be achieved over GraphQL after setting the correct Hasura permissions to the `auth.security_keys` table:
```graphql
query securityKeys($userId: uuid!) {
authUserSecurityKeys(where: { userId: { _eq: $userId } }) {
id
nickname
}
}
mutation removeSecurityKey($id: uuid!) {
deleteAuthUserSecurityKey(id: $id) {
id
}
}
```

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

@@ -1,10 +1,11 @@
---
title: Sign in with Facebook
sidebar_position: 2
title: Sign In with Facebook
sidebar_label: Facebook
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
@@ -15,53 +16,53 @@ Follow this guide to sign in users with Facebook with your Nhost App.
/>
</p>
## Create Facebook account
## Create Facebook Account
- Create a new [Facebook account](https://www.facebook.com/) if you don't have one already.
## Create Facebook App
- Go to [Meta for Developers](https://developers.facebook.com/).
- Click **My Apps** in the top right
- Click **My Apps** in the top right.
- Click **Create App** in the top right.
- Select your **app type** (e.g. Consumer).
- Click **Next**.
- Fill in the **Display name.**
- Fill in the **Display name**.
- Click **Create app**.
## Set up Facebook Login
- Click on Add Product in the left menu.
- Click on Setup in the Facebook login card.
- Click on **Add Product** in the left menu.
- Click on **Setup** on the Facebook login card.
- **Don't** complete the quickstart. Instead, follow the next step.
- Click on **Settings** under **Facebook Login** in the left menu.
- Make sure **Embedded Browser OAuth Login** is set to **Yes**.
- Fill in **Valid OAuth Redirect URIs** with your **OAuth Callback URL** from Nhost.
- Click **Save changes**.
## Activate Facebook permissions and features
## Activate Facebook Permissions and Features
To make sure we can fetch all user data (email, profile picture and name). For that we need to enable **email** and **public_profile** permissions.
- Click on App Review and Permission and Features in the left menu
- Search and for **email** in the **Search Permissions and Features** search box**.**
- Click on App Review and Permission and Features in the left menu.
- Search for **email** in the **Search Permissions and Features** search box.
- Click on Request advanced access and complete the steps.
- Search and for **public_profile** in the **Search Permissions and Features** search box**.**
- Search for **public_profile** in the **Search Permissions and Features** search box.
- Click on **Request advanced access** and complete the steps.
## Configure Nhost
- Click **Settings** and then **Basic** in the left menu.
- Copy and paste the **App ID (Client ID)** and **App secret (Client Secret)** from Facebook to your Nhost OAuth settings for Facebook. Make sure the [OAuth provider is enabled in Nhost](/platform/authentication/social-sign-in#enabling-social-sign-in-provider).
- Copy and paste the **App ID (Client ID)** and **App secret (Client Secret)** from Facebook to your Nhost OAuth settings for Facebook. Make sure the OAuth provider is enabled in Nhost.
- Click the checkbox “**I have pasted the redirect URI into Facebook”**.
- Click **Confirm settings**.
## Sign In users in your app
## Sign In Users
Use the [Nhost JavaScript client](/reference/sdk) to sign in users in your app:
Use the [Nhost JavaScript client](/reference/javascript) to sign in users:
```js
nhost.auth.signIn({
provider: 'facebook',
});
provider: 'facebook'
})
```

View File

@@ -1,10 +1,11 @@
---
title: Sign in with GitHub
sidebar_position: 3
title: Sign In with GitHub
sidebar_label: GitHub
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
@@ -15,7 +16,7 @@ Follow this guide to sign in users with GitHub with your Nhost App.
/>
</p>
## Create GitHub account
## Create GitHub Account
- Create a new [GitHub account](https://github.com/signup) if you don't have one already.
@@ -23,30 +24,30 @@ Follow this guide to sign in users with GitHub with your Nhost App.
- Create a new OAuth application [(direct link)](https://github.com/settings/applications/new) by:
- Click on your profile photo in the top right.
- Click on Settings
- Click on Settings.
- In the left menu, click Developer settings at the bottom.
- Click on Oauth Apps in the left menu
- Click on New OAuth App button in the top right
- Click on Oauth Apps in the left menu.
- Click on New OAuth App button in the top right.
## GitHub OAuth App information
## GitHub OAuth App Information
- Fill in Application Name
- Fill in Homepage URL
- Fill in **Authorization callback URL** with your OAuth Callbacke URL from Nhost
- Fill in Application Name.
- Fill in Homepage URL.
- Fill in **Authorization callback URL** with your OAuth Callbacke URL from Nhost.
## Configure Nhost
- Click Generate a new client secret to generate a OAuth client secret.
- Copy and paste the **Client ID** and **Client Secret** from GitHub to your Nhost OAuth settings for GitHub. Make sure the [OAuth provider is enabled in Nhost](/platform/authentication/social-sign-in#enabling-social-sign-in-provider).
- Click Generate a new client secret to generate an OAuth client secret.
- Copy and paste the **Client ID** and **Client Secret** from GitHub to your Nhost OAuth settings for GitHub. Make sure the OAuth provider is enabled in Nhost.
- Click the checkbox “**I have pasted the redirect URI into GitHub”**.
- Click **Confirm settings**.
## Sign In users in your app
## Sign In Users
Use the [Nhost JavaScript client](/reference/sdk) to sign in users in your app:
Use the [Nhost JavaScript client](/reference/javascript) to sign in users:
```js
nhost.auth.signIn({
provider: 'github',
});
provider: 'github'
})
```

View File

@@ -1,10 +1,11 @@
---
title: Sign in with Google
sidebar_position: 1
title: Sign In with Google
sidebar_label: Google
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
@@ -15,17 +16,17 @@ Follow this guide to sign in users with Google with your Nhost App.
/>
</p>
## Sign up for Google
## Sign Up for Google
- Sign up for [Google Cloud](https://cloud.google.com/free) if you dont have one already.
- Sign up for [Google Cloud](https://cloud.google.com/free) if you don't have one already.
## Create a Google Cloud Project
> 💡 You can skip this step if you already have a Google Cloud project you want to use.
- Create a new Google Cloud project if you dont already have a project you want to use.
- Create a new Google Cloud project if you don't already have a project you want to use.
## Configure OAuth consent screen
## Configure OAuth Consent Screen
- Search for **OAuth consent screen** in the top search bar in the Google Cloud Console.
- Click on **OAuth consent screen** in the search results.
@@ -33,16 +34,16 @@ Follow this guide to sign in users with Google with your Nhost App.
## **Edit app registration**
### OAuth consent screen
### OAuth Consent Screen
- Fill in your App information.
- Click **SAVE AND CONTINUE.**
- Click **SAVE AND CONTINUE**.
### Scopes
- Click **SAVE AND CONTINUE**.
### Test user
### Test User
- Click **SAVE AND CONTINUE**.
@@ -50,7 +51,7 @@ Follow this guide to sign in users with Google with your Nhost App.
- Click **BACK TO DASHBOARD**.
## Create credentials
## Create Credentials
- Click on **Credentials** under **APIs & Services** in the left menu.
- Click **+ CREATE CREDENTIALS** and then **OAuth client ID** in the top menu.
@@ -60,17 +61,17 @@ Follow this guide to sign in users with Google with your Nhost App.
## Configure Nhost
- A modal appears with your Google Client ID and Client secret.
- A modal appears with your Google Client ID and Client Secret.
- Copy and paste the **Client ID** and **Client Secret** from Google to your Nhost OAuth settings for Google. Make sure the OAuth provider is enabled in Nhost.
- Click the checkbox “**I have pasted the redirect URI into Google”**.
- Click **Confirm settings**.
## Sign In users in your 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({
provider: 'google',
});
provider: 'google'
})
```

View File

@@ -1,10 +1,11 @@
---
title: Sign in with LinkedIn
sidebar_position: 4
title: Sign In with LinkedIn
sidebar_label: LinkedIn
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
@@ -15,11 +16,11 @@ Follow this guide to sign in users with LinkedIn with your Nhost App.
/>
</p>
## Create LinkedIn account
## Create LinkedIn Account
- Create a [LinkedIn account](https://linkedin.com/) if you don't have one already.
## Create LinkedIn OAuth App
## Create a LinkedIn OAuth App
- Go to the [LinkedIn Developer Dashboard](https://www.linkedin.com/developers/apps).
- Click on Create App in the top right.
@@ -27,10 +28,10 @@ Follow this guide to sign in users with LinkedIn with your Nhost App.
- Click **“I have read and agree to these terms”**.
- Click **Create app** in the bottom right.
## LinkedIn OAuth App information
## LinkedIn OAuth App Information
- Click on **Auth** in the top menu.
- Click on the **pen icon** under **OAuth 2.0 settings** and right next to **Authorized redirect URLs for your app.**
- Click on the **pen icon** under **OAuth 2.0 settings** and right next to **Authorized redirect URLs for your app**.
- Click **Add redirect URL**.
- Copy and past the **OAuth Callback URL** from Nhost.
- Click **Update**.
@@ -43,17 +44,17 @@ Follow this guide to sign in users with LinkedIn with your Nhost App.
## Enable Auth for your LinkedIn OAuth App
- Click on **Products** in the top menu
- Click on **Products** in the top menu.
- Click Select on the **Sign In with LinkedIn**.
- Check the checkbox **I have read and agree to these terms.**
- Check the checkbox **I have read and agree to these terms**.
- Click **Add product**.
## Sign In users in your app
## Sign In Users
Use the [Nhost JavaScript client](/reference/sdk) to sign in users in your app:
Use the [Nhost JavaScript client](/reference/javascript) to sign in users:
```js
nhost.auth.signIn({
provider: 'linkedin',
});
provider: 'linkedin'
})
```

View File

@@ -1,10 +1,11 @@
---
title: Sign in with Spotify
sidebar_position: 5
title: Sign In with Spotify
sidebar_label: Spotify
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
@@ -15,7 +16,7 @@ Follow this guide to sign in users with Spotify with your Nhost App.
/>
</p>
## Create Spotify account
## Create Spotify Account
- Create a new [Spotify account](https://www.spotify.com/) if you don't have one already.
@@ -23,13 +24,13 @@ Follow this guide to sign in users with Spotify with your Nhost App.
- Go to the [Spotify Developer Dashboard](https://developer.spotify.com/dashboard/).
- Click on CREATE AN APP.
- Fill in a App name and App description
- Check the box to aggre Spotify's [Developer Terms of Service](https://developer.spotify.com/terms) and [Branding Guidelines](https://developer.spotify.com/branding-guidelines).
- Fill in an App name and App description.
- Check the box to agree Spotify's [Developer Terms of Service](https://developer.spotify.com/terms) and [Branding Guidelines](https://developer.spotify.com/branding-guidelines).
## Configure OAuth Callback URL
- Click EDIT SETTINGS
- A modal appears
- Click EDIT SETTINGS.
- A modal appears.
- Fill in **Redirect URIs** with your **OAuth Callback URL** from Nhost.
- Click ADD to add the OAuth callback URL.
- Click SAVE.
@@ -41,12 +42,12 @@ Follow this guide to sign in users with Spotify with your Nhost App.
- Click the checkbox “**I have pasted the redirect URI into Spotify”**.
- Click **Confirm settings**.
## Sign In users in your app
## Sign In Users
Use the [Nhost JavaScript client](/reference/sdk) to sign in users in your app:
Use the [Nhost JavaScript client](/reference/javascript) to sign in users:
```js
nhost.auth.signIn({
provider: 'spotify',
});
provider: 'spotify'
})
```

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

@@ -0,0 +1,4 @@
{
"label": "Sign-In Methods",
"position": 2
}

View File

@@ -0,0 +1,20 @@
---
title: 'Sign-In Methods'
slug: /platform/authentication/sign-in-methods
image: /img/og/platform/sign-in-methods.png
---
Nhost Authentication support the following sign-in methods:
- [Email and Password](/platform/authentication/sign-in-with-email-and-password)
- [Magic Link](/platform/authentication/sign-in-with-magic-link)
- [Phone Number (SMS)](/platform/authentication/sign-in-with-phone-number-sms)
- [Security Keys (WebAuthn)](/platform/authentication/sign-in-with-phone-number-sms)
- [Apple](/platform/authentication/sign-in-with-apple)
- [Discord](/platform/authentication/sign-in-with-discord)
- [Facebook](/platform/authentication/sign-in-with-facebook)
- [GitHub](/platform/authentication/sign-in-with-github)
- [Google](/platform/authentication/sign-in-with-google)
- [LinkedIn](/platform/authentication/sign-in-with-linkedin)
- [Spotify](/platform/authentication/sign-in-with-spotify)
- [Twitch](/platform/authentication/sign-in-with-twitch)

View File

@@ -0,0 +1,46 @@
---
title: Social Providers Configuration
sidebar_label: Social Providers Configuration
sidebar_position: 10
---
## Enabling Social Sign-In Provider
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 for your project.
Here's an example of how to implement sign-in with GitHub:
```js
nhost.auth.signIn({
provider: 'github'
})
```
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.
## Provider OAuth Tokens
Nhost saves both access and refresh tokens for each user and provider in the `auth.user_providers` table. These tokens can be used to interact with the provider if needed.

View File

@@ -0,0 +1,74 @@
---
title: Tokens
sidebar_label: Tokens
sidebar_position: 10
image: /img/og/platform/tokens.png
---
Nhost Authentication makes use of two types of tokens:
- **Access token** - used to authenticate a user and access APIs.
- **Refresh token** - used to get a new access token.
Users get both an access token and a refresh token when they sign in.
:::info
If you're using the [Nhost JavaScript client](/reference/javascript), all tokens are automatically set and updated for you. But it can still be good to understand how they work.
:::
## Access Token
An access token (also called [JSON Web Token or JWT](https://en.wikipedia.org/wiki/JSON_Web_Token)) contains information about the user such as the user id. Users send this token to the Nhost services (GraphQL, Auth, Storage, Serverless Functions) to let the services know who's making the request so the services can verify the user's identity and resolve the correct permissions.
The access token is added as an `Authorization` header when making a request, like this:
```http title="Header"
Authorization: Bearer <access_token>
```
Here's an example of an encoded access token:
```
eyJhbGciOiJIUzI1NiJ9.eyJodHRwczovL2hhc3VyYS5pby9qd3QvY2xhaW1zIjp7IngtaGFzdXJhLWFsbG93ZWQtcm9sZXMiOlsibWUiLCJ1c2VyIl0sIngtaGFzdXJhLWRlZmF1bHQtcm9sZSI6InVzZXIiLCJ4LWhhc3VyYS11c2VyLWlkIjoiMTUzODYzZjktZTQwMC00Njg2LTgyMTEtMzI0OGNjYWY2MGJhIiwieC1oYXN1cmEtdXNlci1pcy1hbm9ueW1vdXMiOiJmYWxzZSJ9LCJzdWIiOiIxNTM4NjNmOS1lNDAwLTQ2ODYtODIxMS0zMjQ4Y2NhZjYwYmEiLCJpc3MiOiJoYXN1cmEtYXV0aCIsImlhdCI6MTY1Mzg5MjA5NCwiZXhwIjoxNjUzODkyOTk0fQ.9nVL2Lj8KWBW3WrjJr4tPNH3_29qJKKKSDRNYebhiHI
```
The decoded payload of this access token is a JSON object that looks like this:
```json
{
"https://hasura.io/jwt/claims": {
"x-hasura-allowed-roles": ["me", "user"],
"x-hasura-default-role": "user",
"x-hasura-user-id": "153863f9-e400-4686-8211-3248ccaf60ba",
"x-hasura-user-is-anonymous": "false"
},
"sub": "153863f9-e400-4686-8211-3248ccaf60ba",
"iss": "hasura-auth",
"iat": 1653892094,
"exp": 1653892994
}
```
The token contains information about the user id, default role, allowed roles, if the user is anonymous or not, and other metadata.
The claims under `https://hasura.io/jwt/claims` are the same claims that are used by the GraphQL API to create [permissions](/platform/graphql/permissions). The claims (`x-hasura-*`) are also called permission variables. It's possible to add custom [permission variables](/platform/graphql/permissions#custom-permission-variables).
:::info
You can manually decode an access token using [JWT.io](https://jwt.io/).
:::
The token is cryptographically signed by Nhost Authentication, which means that all other Nhost services can trust the information in the token.
:::info
Use the `NHOST_JWT_SECRET` [system environment variable](/platform/environment-variables#system-environment-variables) to verify access tokens in [Serverless Functions](/platform/serverless-functions). Here's a guide on how to [Get the authenticated user in a Serverless Function](https://github.com/nhost/nhost/discussions/278).
:::
The access token can not be revoked. Instead, the token is only valid for 15 minutes. The user can get a new access token by using the refresh token.
## Refresh Token
A refresh token is used to request a new access token. Refresh tokens are long-lived tokens stored in the database in the `auth.refresh_tokens` table.
Refresh tokens are valid for 30 days.
To revoke a refresh token, simply delete it from the database.

View File

@@ -1,87 +0,0 @@
---
title: 'User management'
sidebar_position: 1
---
Users are saved in the database in the `auth.users` table and are accessible via the GraphQL API.
---
## Querying users
Example of getting all users in GraphQL:
```graphql
query {
users {
id
displayName
email
}
}
```
Example of getting one user in GraphQL:
```graphql
query {
user(id: "<user-id>") {
id
displayName
email
}
}
```
---
## Creating users
Users should be created using the sign-up or sign-in flows as described under [sign-in methods](/platform/authentication/sign-in-methods).
**Never** create users directly via GraphQL or database. **Never** modify the `auth.users` table. **Never** modify the GraphQL root queries.
You can update the permissions of the `auth.users` table.
---
## Roles
Each user can have one or multiple roles for API requests. You can see the roles of a user and set a default role in Nhost Console under **Users**.
Every GraphQL request is made with a specific role. This role will be used to resolve permissions when querying the database. In other words, every user can have multiple roles, but only one role will be applied for any given GraphQL request.
### Defaults
For new apps, the following roles are available:
- Available roles: `user` and `me`
- Default role: `user`
### Public role
If the user is not signed in, the `public` role will be used.
### Set request role in GraphQL
When no request role is specified, the user's default role will be used:
```js
await nhost.graphql.request(QUERY, {});
```
Make a GraphQL request with the `me` role:
```js
await nhost.graphql.request(
QUERY,
{},
{
headers: {
'x-hasura-role': 'me',
},
},
);
```
If the request is not part of the user's roles, the request will fail.

View File

@@ -0,0 +1,166 @@
---
title: Users
sidebar_label: Users
sidebar_position: 1
image: /img/og/platform/users.png
---
Users are stored in the database in the `users` table in the `auth` schema.
## Get User Information using GraphQL
**Example:** Get all users.
```graphql
query {
users {
id
displayName
email
metadata
}
}
```
**Example:** Get a single user.
```graphql
query {
user(id: "<user-id>") {
id
displayName
email
metadata
}
}
```
## Creating Users
Users should be created using the sign-up or sign-in flows as described under [sign-in methods](/platform/authentication/sign-in-methods).
- **Never** create users directly via GraphQL or database, unless you [import users](#import-users) from an external system.
- **Never** modify the `auth.users` table.
- **Never** modify the GraphQL root queries or fields for any of the tables in the `auth` schema.
You're allowed to:
- Add and remove your GraphQL relationships for the `users` table and other tables in the `auth` schema.
- Create, edit and delete permissions for the `users` table and other tables in the `auth` schema.
## Roles
Each user can have one or multiple roles for API requests. You can see the roles of a user and set a default role in Nhost Console under **Users**.
Every GraphQL request is made with a specific role. This role will be used to resolve permissions when querying the database. In other words, every user can have multiple roles, but only one role will be applied for any given GraphQL request.
### Default Role
The default role is used when no role is specified in the GraphQL request. By default, users' default role is `user`.
### Allowed Roles
Allowed roles are roles the user is allowed to use when making a GraphQL request. Usually you would change the role from `user` (the default role) to some other role because you want Hasura to use a different role to resolve permissions for a particular GraphQL request.
By default, users have two allowed roles:
- `user`
- `me`
You can manage what allowed roles users should get when they sign up under **Users** -> **Roles & Permissions**.
:::info
You must also add the roles manually to the `auth.roles` table.
:::
It's also possible to give users a subset of allowed roles during signup.
**Example:** Only give the `user` role (without the `me` role) for the user's allowed roles:
```js
await nhost.auth.signUp({
email: 'joe@example.com',
password: 'secret-password'
options: {
allowedRoles: ['user']
}
})
```
### Public Role
The `public` role is used to resolve GraphQL permissions for unauthenticated users.
### Set Role for GraphQL Requests
When no request role is specified, the user's default role will be used:
```js
await nhost.graphql.request(QUERY, {})
```
Make a GraphQL request with the `me` role:
```js
await nhost.graphql.request(
QUERY,
{},
{
headers: {
'x-hasura-role': 'me'
}
}
)
```
If the request is not part of the user's allowed roles, the request will fail.
## Metadata
You can store custom information about the user in the `metadata` column of the `users` table. The `metadata` column is of type JSONB so any JSON data can be stored.
This is how you attach custom metadata to a user during sign-up:
```js
await nhost.auth.signUp({
email: 'joe@example.com',
password: 'secret-password',
options: {
metadata: {
birthYear: 1989,
town: 'Stockholm',
likes: ['Postgres', 'GraphQL', 'Hasura', 'Authentication', 'Storage', 'Serverless Functions']
}
}
})
```
## Import Users
If you have users in a different system, you can import them into Nhost. When importing users you should insert the users directly into the database instead of using the authentication endpoints (`/signup/email-password`).
It's possible to insert users via GraphQL or SQL.
### GraphQL
Make a GraphQL request to insert a user like this:
```graphql
mutation insertUser($user: users_insert_input!) {
insertUser(object: $user) {
id
}
}
```
### SQL
Connect directly to the database and insert a user like this:
```sql
INSERT INTO auth.users (id, email, display_name, password_hash, ..) VALUES ('<user-id>', '<email>', '<display-name>', '<password-hash>', ..);
```
User passwords are hashed using [bcrypt](https://en.wikipedia.org/wiki/Bcrypt) in Nhost.

121
docs/docs/platform/cli.mdx Normal file
View File

@@ -0,0 +1,121 @@
---
title: 'CLI'
sidebar_position: 11
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 projects locally on Mac, Linux and Windows (WSL2).
This means you get a full-featured Nhost project running locally on your machine:
- Postgres Database
- Hasura GraphQL API
- Hasura Console
- Auth
- Storage
- Serverless Functions
This way, you can develop and test local changes before you deploy them live. The CLI automatically tracks:
- Postgres database migrations
- Hasura metadata
- Serverless functions
It's recommended to commit and push changes to GitHub and use the [GitHub integration](/platform/github-integration) for Nhost to automatically deploy those changes live.
## Installation
To download and install Nhost CLI, run the following command:
```bash
sudo curl -L https://raw.githubusercontent.com/nhost/cli/main/get.sh | bash
```
### Dependencies
The following dependencies are required:
- [Git](https://git-scm.com/downloads)
- [Docker](https://www.docker.com/get-started) (must be running while using the CLI)
:::info
Make sure you have the correct permissions for Docker so you don't have to run Docker with `sudo`. See ["Post-installation steps for Linux"](https://docs.docker.com/engine/install/linux-postinstall/) from Docker's documentation.
:::
## Get started
Start by authenticating yourself to Nhost Cloud:
```
nhost login
```
Once signed in, you can list all your Nhost projects using:
```
nhost list
```
Let's start by initializing a remote Nhost project locally with the following command:
```
nhost init --remote
```
Pick a Nhost project to use then change the directory once the project initialization is completed:
```
cd my_test_app
```
Then start the Nhost project locally:
```
nhost up
```
Hasura Console starts automatically and your Nhost project is running locally.
## Subdomain and Region
Use `localhost` 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',
})
```
## Emails
During local development with the CLI, all transactional emails from Authentication are sent to a local Mailhog instance, instead of to the recipient's email address. You'll see an address where after starting [`nhost up`](/reference/cli/up) where all emails are sent to.
For the example below, all emails are accessible at `http://localhost:8025`.
```bash
$ nhost up
URLs:
- Postgres: postgres://postgres:postgres@localhost:5432/postgres
- GraphQL: http://localhost:1337/v1/graphql
- Auth: http://localhost:1337/v1/auth
- Storage: http://localhost:1337/v1/storage
- Functions: http://localhost:1337/v1/functions
- Hasura console: http://localhost:9695
- Mailhog: http://localhost:8025
- subdomain: localhost
- region: (empty)
```
## What's next?
- Read our in-depth guide on [Get started with Nhost CLI](/platform/overview/get-started-with-nhost-cli)
- [CLI commands reference](/reference/cli)

View File

@@ -1,4 +1,4 @@
{
"label": "Database",
"position": 2
"position": 4
}

View File

@@ -0,0 +1,93 @@
---
title: 'Event triggers'
sidebar_position: 2
image: /img/og/platform/event-triggers.png
---
Event Triggers enable you to invoke webhooks when a database event happens. Event Triggers are typically used to do post-processing tasks, using custom backend code, based on database events.
Event Triggers are associated with a specific table in the database and the following event types are available:
- **INSERT** - A row is inserted into a table.
- **UPDATE** - A row is updated in a table.
- **DELETE** - A row is deleted from a table.
:::info
It's currently only possible to create Event Triggers in the Hasura Console. We're working on adding support for creating Event Triggers in the Nhost Dashboard.
:::
### Example Use Case
Let's say you're building an e-commerce application and you want to send an email to the customer when a new order is placed. Orders are stored in the `orders` table in your database.
To send out an email every time a new order is placed, you create an event trigger that listens for the `INSERT` event on the `orders` table. Now every time an order is placed, the event trigger invokes a webhook with the order information, and the webhook sends out the email.
## Create Event Trigger
Event Triggers are managed in the Hasura Console. Select **Events** in the main menu and click **Create** to add an Event Trigger.
<video width="99%" autoPlay muted loop controls="true">
<source src="/videos/hasura-create-event-trigger.mp4" type="video/mp4" />
</video>
## Event Triggers and Serverless Functions
Event Triggers and [Serverless Functions](/platform/serverless-functions) is a perfect combination to build powerful database-backend logic. Every Serverless Function is exposed as an HTTP endpoint and can be used as a webhook for Event Triggers.
### Format
When using Serverless Functions as webhooks you should configure the webhook using a combination of environment variables and endpoints like this:
```
{{NHOST_BACKEND_URL}}/v1/functions/orders-insert-send-email
```
![Webhook URL Format](/img/database/event-triggers/webhook-url-format.png)
The `NHOST_BACKEND_URL` is a [system environment variable](/platform/environment-variables#system-environment-variables) and available in production and in development environments using the [CLI](/platform/cli).
### Security
To make sure incoming requests to your webhook comes from Hasura, and not some malicious third party, you can use a shared webhook secret between Hasura and your webhook handler (e.g. your Serverless Function).
It is recommended to use the `NHOST_WEBHOOK_SECRET`, which is a [system environment variable](/platform/environment-variables#system-environment-variables) and available in production and in development environments using the [CLI](/platform/cli). The `NHOST_WEBHOOK_SECRET` is available both in Hasura and in every Serverless Function.
To set this up is a two-step process:
- Step 1: Add the header `nhost-webhook-secret` with the value `NHOST_WEBHOOK_SECRET` (From env var) when creating the Event Trigger in the Hasura Console.
![Webhook Secret Header](/img/database/event-triggers/webhook-secret-header.png)
- Step 2: Check the header `nhost-webhook-secret` for incoming requests and make sure the header is the same as the environment variable `NHOST_WEBHOOK_SECRET`.
Here is an example of how to check the header in a Serverless Function:
```js
export default async function handler(req, res) {
// Check header to make sure the request comes from Hasura
if (req.headers['nhost-webhook-secret'] !== process.env.NHOST_WEBHOOK_SECRET) {
return res.status(400).send('Incorrect webhook secret')
}
// Do something
// Example:
// - Send an email
// - Create a subscription in Stripe
// - Generate a PDF
// - Send a message to Slack or Discord
// - Update some data in the database
console.log(JSON.stringify(req.body, null, 2))
return res.send('OK')
}
```
The `NHOST_WEBHOOK_SECRET` is a [system environment variable](/platform/environment-variables#system-environment-variables) and available in production and in development environments using the [CLI](/platform/cli).
## Next Steps
- Read the full [Event Triggers documentation from Hasura](https://hasura.io/docs/latest/graphql/core/event-triggers/index/).
- Learn about the [GraphQL API](/platform/graphql).

View File

@@ -1,48 +0,0 @@
---
title: 'Database'
sidebar_position: 1
---
Every Nhost app comes with a Postgres database. Postgres is the world's most advanced open-source relational database and the most popular SQL database among developers. The database is hosted with Amazon RDS.
Tables are managed in the Hasura Console.
---
## Creating tables
1. In Hasura Console, go to the **Data** tab, select the **public** schema in the left menu and click **Create Table**
2. Enter a table name
3. Add table columns
4. Add a primary key (usually the ID column)
5. (Optional) Add foreign keys
6. (Optional) Add unique keys
7. Click **Add Table**
When a table is created, the table is created in Postgres and added to your GraphQL API.
#### Schemas
You should use the `public` schema when developing your app. `auth` and `storage` are reserved for system functionality like user and file management. You are allowed to modify permissions for tables in the `auth` and `storage` schemas, however.
---
## Modifying table schema
1. In Hasura Console, go to the **Data** tab and click on the table you want to edit in the left menu
2. Click **Modify**
3. Modify or add table columns
#### Track foreign-key relations
1. Click on Data in the top menu.
2. A list of untracked foreign-key relations is presented.
3. Click Track All (recommended) or click Track for each relationship you want to track.
---
## Deleting tables
1. In Hasura Console, go to the **Data** tab and select the table you want to delete in the left menu
2. Click **Modify**
3. Scroll to the bottom of the page and click **Delete table** to open the confirmation dialog

View File

@@ -0,0 +1,180 @@
---
title: 'Database'
sidebar_position: 1
image: /img/og/platform/database.png
---
import Tabs from '@theme/Tabs'
import TabItem from '@theme/TabItem'
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).
There are three ways of managing your database:
1. Nhost Database UI (recommended).
2. Hasura Console.
3. [Connect directly to the database.](#postgres-access)
## Schemas
Generally, you should use the `public` schema for your project. It's also ok to add custom schemas for more advanced usage.
The two schemas `auth` and `storage` are reserved for [Nhost Auth](/platform/authentication) and [Nhost Storage](/platform/storage). 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.
## Manage Tables
### Create Table
1. Go to **Database** in the left menu.
2. Click **New table**.
3. Enter a **name** for the table.
4. Add **columns**.
5. Select a **Primary Key** (usually the `id` column).
6. (Optional) Select an **Identity** column. Identity is for integer columns only and is usually selected for the `id` column so the `id` is automatically incremented (1,2,3...) on new rows.
7. (Optional) Add **Foreign Keys**.
8. Click **Create**.
When a table is created it is instantly available through the [GraphQL API](/platform/graphql).
Here's an example of how to create a `customers` table:
<Tabs groupId="nhost-vs-sql">
<TabItem value="nhost" label="Nhost" default>
<video width="99%" autoPlay muted loop controls="true">
<source src="/videos/nhost-table-create.mp4" type="video/mp4" />
</video>
</TabItem>
<TabItem value="sql" label="SQL">
```sql
CREATE TABLE "public"."customers" (
"id" bigint PRIMARY KEY GENERATED ALWAYS AS IDENTITY,
"name" text NOT NULL
);
```
</TabItem>
</Tabs>
### Edit Table
1. Go to the **Database** in the left menu
2. Click on the **context menu** of the table you want to change and click **Edit table**.
3. **Edit** (add, change, delete) the table's columns.
4. Click **Save**.
Here's an example of how to edit a `customers` table by adding an `address` column:
<Tabs groupId="nhost-vs-sql">
<TabItem value="nhost" label="Nhost" default>
<video width="99%" autoPlay muted loop controls="true">
<source src="/videos/nhost-table-edit.mp4" type="video/mp4" />
</video>
</TabItem>
<TabItem value="sql" label="SQL">
```sql
ALTER TABLE "public"."customers" ADD COLUMN "address" text;
```
</TabItem>
</Tabs>
### Delete Table
1. Go to the **Database** in the left menu
2. Click on the **context menu** of the table you want to delete and click **Delete table**.
3. Click **Delete** to confirm deleting the table.
**Example:** Delete a `customers` table:
<Tabs groupId="nhost-vs-sql">
<TabItem value="nhost" label="Nhost" default>
<video width="99%" autoPlay muted loop controls="true">
<source src="/videos/nhost-table-delete.mp4" type="video/mp4" />
</video>
</TabItem>
<TabItem value="sql" label="SQL">
```sql
DROP TABLE "public"."customers";
```
</TabItem>
</Tabs>
## Postgres Access
It's possible to access your Postgres database directly with your favorite Postgres client.
:::info
For projects older than September 2022, it's not possible to connect directly to the database via a connection string. We're working on a one-click fix that can be expected to be available in October 2022.
:::
Go to **Settings** in the left menu and click on **Database**. You'll find the connection string and credentials to connect to your database.
![Database Connection Info](/img/database/connection-info.png)
### Reset Postgres Password
It's possible to reset the database password that was provided when the project was created.
1. Go to the **Overview** page of your project.
2. Click on **Project Settings**.
3. Click on **Reset Database Password**.
4. Either **copy** the newly automatically generated password, or **type** your own new database password.
5. Click **Reset Database Password**.
<video width="99%" autoPlay muted loop controls="true">
<source src="/videos/nhost-database-reset-password.mp4" type="video/mp4" />
</video>
## Migrations
To track database changes, use the [Nhost CLI](/platform/cli) to develop locally and use our [GitHub integration](/platform/github-integration) to automatically deploy database migrations live.
1. Develop locally using the Nhost CLI.
2. Push changes to GitHub.
3. Nhost automatically deploys changes.
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 the [Pro and Enterprise plans](https://nhost.io/pricing) are automatically backed up daily.
## Best Practices
- Use lower-case names for tables. E.g. `customers` instead of `Customers`.
- Use plural names for tables. E.g. `customers` instead of `customer`.
- use underscore (`_`) instead of camelCase for table names. E.g. `customer_invoices` instead of `customerInvoices`.
- use underscore (`_`) instead of camelCase for column names. E.g. `first_name` instead of `firstName`.
## Next Steps
- [Learn PostgreSQL Tutorial - Full Course for Beginners (YouTube)](https://www.youtube.com/watch?v=qw--VYLpxG4).
- Learn more about how to manage your [Postgres database in Hasura](https://hasura.io/docs/latest/graphql/core/databases/postgres/schema/index/).
- Learn about the [GraphQL API](/platform/graphql).

View File

@@ -0,0 +1,44 @@
---
title: 'Environment Variables'
sidebar_position: 9
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 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 project again using the [GitHub integration](/platform/github-integration) for the changes to take effect.
Environment Variables are available in:
- Hasura
- Serverless Functions
## System Environment Variables
System Environment Variables are automatically available in production and during development. The following system Environment Variables are available:
- `NHOST_ADMIN_SECRET`
- `NHOST_WEBHOOK_SECRET`
- `NHOST_JWT_SECRET`
- `NHOST_BACKEND_URL`
Example values:
```bash
NHOST_ADMIN_SECRET=e7w36ag287qn5qry795f6ymm57qgvqup
NHOST_WEBHOOK_SECRET=ns3sfjgdw4y6zeqthwnnw347dzh8wyj4
NHOST_JWT_SECRET={"type": "HS256", "key": "vumpbe2w2mgaqj5yqfp7dvxu6kywtvsgb68ejpdaqxerea8
jwrsszdp2dhkjxsh4df69pzm3ja6ukedx8ja43zdt6q9kgbgg2w9vh2sedeppukud9a2qzy29v3afdn7m"}
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:
1. Edit the `.env.development` file manually.
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

@@ -0,0 +1,57 @@
---
title: 'GitHub Integration'
sidebar_position: 10
image: /img/og/platform/github-integration.png
---
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 project, Nhost automatically deploys changes when you push code to the repo.
The following things are deployed:
- Database migrations
- Hasura metadata
- Serverless Functions
:::info
Settings in `nhost/config.yaml` are **not** deployed. That means you need to manually sync settings between local and remote environments between the CLI and Nhost Cloud.
:::
## Connecting a GitHub repository
1. From your Nhost project, click **Connect to Github**.
![Connect to GitHub](/img/architecture/cli/connect-repo-step-1.png)
2. **Install the Nhost project** on your Github account.
![Install the Nhost GitHub App](/img/architecture/cli/connect-repo-step-2.png)
3. **Connect** your Github repository.
![Select reopsitoru](/img/architecture/cli/connect-repo-step-3.png)
## Deployment Branch
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 project's Overview.
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%" />
</center>
## Base Directory
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%" />
</center>
## Next Steps
- Learn how to [use the CLI to deploy your Nhost project](/platform/overview/get-started-with-nhost-cli).

View File

@@ -1,4 +1,4 @@
{
"label": "GraphQL",
"position": 3
"position": 5
}

View File

@@ -1,43 +1,55 @@
---
title: 'GraphQL'
sidebar_position: 1
image: /img/og/platform/graphql.png
---
Every Nhost app has its own autogenerated GraphQL API. The GraphQL API is based on the tables and columns in the [Postgres database](/platform/database) and is instantly available. It's [Hasura GraphQL engine](https://github.com/hasura/graphql-engine) that powers the GraphQL API.
A GraphQL API is automatically and instantly available based on the tables and columns in your [database](/platform/database).
The GraphQL API is available at: `https://[subdomain].nhost.run/v1/graphql`.
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.
## What is GraphQL
GraphQL is a query language for APIs that prioritize developer experience. The GraphQL API can be used to both fetch (query) and modify (mutation) data. GraphQL is especially powerful for frontend developers who wants to build products fast.
GraphQL is a query language for APIs that prioritize developer experience. The GraphQL API can be used to both fetch (query) and modify (mutation) data. GraphQL is especially powerful for frontend developers who want to build products fast.
### GraphQL clients for JavaScript
GraphQL has grown rapidly in popularity in the last years and has been adopted by almost all major tech companies such as Facebook, GitHub, and Stripe.
To interact with the GraphQL API it's recommended to use a GraphQL client:
Building your GraphQL API is a lot of work, but with Nhost it's easy because every table and column is instantly available in your GraphQL API.
- [Apollo Client](https://www.apollographql.com/docs/react/)
## Endpoint
The GraphQL API is available at `https://[subdomain].nhost.run/v1/graphql` When using the [CLI](/platform/cli) the GraphQL API is available at `http://localhost:1337/v1/graphql`.
## GraphQL Clients for JavaScript
The Nhost JavaScript client comes with a simple [GraphQL client](/reference/javascript/nhost-js/graphql) that works well for the backend or simple applications.
When building more complex frontend applications, we recommend using a more advanced GraphQL client such as:
- [Apollo Client](https://www.apollographql.com/docs/react/):
- [Nhost Apollo Client for React](/reference/react/apollo)
- [Nhost Apollo Client for Vue](/reference/vue/apollo)
- [URQL](https://formidable.com/open-source/urql/)
- [React Query](https://react-query.tanstack.com/graphql)
- [SWR](https://swr.vercel.app/docs/data-fetching#graphql)
It's also possible to use the built-in [GraphQL client](/reference/sdk/graphql) in the Nhost JavaScript client.
---
## GraphQL Query
## Queries
A GraphQL query is used to fetch data from the database.
Here is a GraphQL query that selects `title`, `body`, and `isCompleted` for every row in a `todos` table.
:::tip
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:**
**Example:** A GraphQL query to select `title`, `body`, and `isCompleted` for every row in the `todos` table.
```graphql
```graphql title=GraphQL
query GetTodos {
todos {
title
body
done
isCompleted
}
}
@@ -45,7 +57,7 @@ query GetTodos {
**Response:**
```json
```json title=Response
{
"data": {
"todos": [
@@ -61,11 +73,11 @@ query GetTodos {
#### Filtering and sorting
GraphQL queries More complex queries utilize filters, limits, sorting and aggregation.
More complex queries utilize filters, limits, sorting, and aggregation.
This GraphQL query selects all items in the todo table that aren't done, with the total number of comments and the last five comments:
Here's an example of a more complex GraphQL query that selects all items in the `todos` table that aren not completed, with the total number of comments and the last five comments:
```graphql
```graphql title=GraphQL
query GetTodosWithLatestComments {
todos(where: { isCompleted: { _eq: false } }) {
title
@@ -84,15 +96,13 @@ query GetTodosWithLatestComments {
}
```
Response:
```json
```json title=Response
{
"data": {
"todos": [
{
"title": "Delete Firebase account",
"body": "Migrate to nhost.io",
"body": "Migrate to Nhost",
"comments": [
{
"comment": "Let's do this",
@@ -116,137 +126,121 @@ Response:
}
```
:::tip
Check out Hasura's documentation for full documentation for GraphQL queries.
## Mutations
[Hasura GraphQL queries](https://hasura.io/docs/latest/graphql/core/databases/postgres/queries/index/)
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 we're using Hasura's GraphQL Engine for your project.
:::
---
### Insert Data
## GraphQL mutations
**Example:** A GraphQL mutation to insert data:
Mutations are used to insert, update or delete data.
### Inserting data
GraphQL mutation to insert data looks like this:
```graphql
```graphql title=GraphQL
mutation InsertTodo {
insert_todos(
objects: [
{
title: "Delete Firebase account"
body: "Migrate to nhost.io"
done: false
}
]
objects: [{ title: "Delete Firebase account", body: "Migrate to Nhost", isCompleted: false }]
) {
returning {
id
title
body
done
isCompleted
}
}
}
```
Response:
```json
```json title=Reponse
{
"data": {
"insert_todos": [
{
"id": "bf4b01ec-8eb6-451b-afac-81f5058ce852",
"title": "Delete Firebase account",
"body": "Migrate to nhost.io",
"done": true
"body": "Migrate to Nhost",
"isCompleted": true
}
]
}
}
```
### Inserting multiple rows
#### Insert Multiple Rows
Multiple rows can be inserted with an array as the objects property. This can be useful for migrating data.
Use an array of objects to insert multiple rows at the same time.
```graphql
**Example:** Insert multiple Todos at the same time:
```graphql title=GraphQL
mutation InsertMultipleTodos {
insert_todos(
objects: [
{
title: "Build the front end"
body: "Mobile app or website first?"
done: false
}
{ title: "Launch 🚀", body: "That was easy", done: false }
{ title: "Build the front end", body: "Mobile app or website first?", isCompleted: false }
{ title: "Launch 🚀", body: "That was easy", isCompleted: false }
]
) {
returning {
id
title
body
done
isCompleted
}
}
}
```
---
## Updating data
### Update Data
You can update existing data with an update mutation. You can update multiple rows at once.
To mark a todo as done, you would use a mutation like this:
**Example:** A GraphQL mutation to mark a atodo item as completed:
```graphql
mutation UpdateTodoStatus($id: uuid, $done: Boolean) {
update_todos(_set: { done: $done }, where: { id: { _eq: $id } }) {
```graphql title=GraphQL
mutation UpdateTodoStatus($id: uuid, $isCompleted: Boolean) {
update_todos(_set: { isCompleted: $isCompleted }, where: { id: { _eq: $id } }) {
returning {
body
done
isCompleted
title
}
}
}
```
Notice how we are using variables as the `id` and `done` variables, which lets us mark any todo as done or not done with the same mutation.
Notice how we are using variables as the `id` and `isDone` variables, which lets us mark any todo as completed or not completed with the same mutation.
### Upsert
### Upsert Data
When you're not sure if a piece of data already exists, use an upsert mutation. It will either insert an object into the database if it doesn't exist, or update the fields of an existing object.
When you're not sure if a piece of data already exists, use an upsert mutation. It will either insert an object into the database if it doesn't exist or update the fields of an existing object.
Unlike for update mutations, you must pass all columns to an upsert mutation.
In order to convert your insert mutation to an upsert, you need to add an `on_conflict` property. This tells Hasura which fields it should use to find duplicates.
To convert your insert mutation to an upsert, you need to add an `on_conflict` property for the GraphQL API to know which fields it should use to find duplicates.
The `on_conflict` key must be a unique key in your database:
```graphql
```graphql title=GraphQL
mutation UpsertTodo {
insert_todos(
objects: { title: "Delete Firebase account", body: "...", done: false }
on_conflict: { constraint: todos_title_key, update_columns: [title, done] }
objects: { title: "Delete Firebase account", body: "...", isCompleted: false }
on_conflict: { constraint: todos_title_key, update_columns: [title, isCompleted] }
) {
returning {
id
title
body
done
isCompleted
}
}
}
```
This will update the body and done properties of the todo titled `"Delete Firebase account"`.
This will update `body` and `done` of the todos with the title "Delete Firebase account".
### Conditional upsert
#### Conditional upsert
Inserts a new object into a table, or if the primary key already exists, updates columns if the `where` condition is met.
@@ -272,7 +266,7 @@ mutation UpsertTodo {
}
```
### Ignore mutation on conflict
#### Ignore mutation on conflict
If `update_columns` is empty, the mutation will be ignored if the object already exists.
@@ -296,13 +290,11 @@ mutation InsertTodo {
In this case, the insert mutation is ignored because a todo with the `title` `"Delete Firebase account"` already exists, and `update_columns` is empty.
---
## Deleting data
### Delete Data
To delete your data, use a delete mutation. This mutation will delete all `todos` where `done` is `true`:
```graphql
```graphql title="GraphQL mutation"
mutation DeleteDoneTodos {
delete_todos(where: { done: { _eq: true } }) {
affected_rows
@@ -316,9 +308,9 @@ If you have set up foreign keys which will restrict a delete violation, you will
## Subscriptions
GraphQL subscriptions are queries that use WebSockets to keep the data up to date in your app in real time:
GraphQL subscriptions are queries that use WebSockets to keep the data up to date in your app in real-time. You only have to change `query` to `subscription` when constructing the GraphQL document:
```graphql
```graphql title="GraphQL subscription"
subscription GetTodos {
todos {
title

View File

@@ -1,35 +1,114 @@
---
title: 'Permissions'
sidebar_position: 1
image: /img/og/platform/permissions.png
---
The GraphQL API is protected by a role-based permission system based on access tokens. Permissions are handled on a per-table basis in Hasura Console.
The GraphQL API is protected by a role-based permission system.
---
For each **role**, you create **rules** for the **select**, **insert**, **update**, and **delete** operations.
## How it works
**Example:** Let's say you have a `posts` table, and you want users to only access their own posts. This is how you would do it:
Upon login a user gets an access token which is then being sent with every GraphQL API request to authenticate the user and apply the correct permissions when reading and writing data.
```sql title="Posts Table"
CREATE TABLE "public"."posts" (
"id" serial NOT NULL PRIMARY KEY,
"title" text NOT NULL,
"user_id" uuid NOT NULL,
);
```
In Hasura you can specify what a user is allowed to do. A common use case is to allow a user to read something if `user_id` in the database is equal to the user ID in the access token.
```json title="Hasura Permission Rule"
{
"user_id": {
"_eq": "X-Hasura-User-Id"
}
}
```
Access token data is included as headers with every API request. By default, every user has the following session variables that can be used when creating permission rules:
The rule above make it so users can only select posts where the value of `user_id` is equal (`_eq`) to their user ID (`x-hasura-user-id`).
- `x-hasura-user-id`
- `x-hasura-allowed-roles`
- `x-hasura-default-role`
## What is `x-hasura-user-id`?
The default role for users is `user`.
`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.
> You can also [add custom permission](#add-permission-variables) varaibles if you need to.
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
## Select permissions
You can add custom permission variables in the Nhost console under **Users** and then **Roles and permissions**. These permission variables are then available when creating permissions for your GraphQL API in the Hasura console.
![Permission Variables](/img/platform/permission-variables-preview.svg)
**Example:**: Let's say you add a new permission variable `x-hasura-organisation-id` with path `user.profile.organisation.id`. This means that Nhost Auth will get the value for `x-hasura-organisation-id` by internally generating the following GraphQL query:
```graphql
query {
user(id: "<User's ID>") {
profile {
organisation {
id
}
}
}
}
```
### Local Custom Permission Variables
To use custom permission variables locally, add your claims to the `config.yml` as following:
```
auth:
jwt:
custom_claims: '{"organisation-id":"profile.organisation.id"}'
```
Your custom claim will be automatically prefixed with `x-hasura-`, therefore, the example above results in a custom permission variable named `x-hasura-organisation-id`.
## Roles
Every GraphQL request is resolved based on a **single role**. Roles are added in the Hasura Console when selecting a table and clicking **Permisisons**.
If the user is not signed in, the GraphQL API resolves permissions using the `public` role.
### Default Role
Every user have one **default role**. The default role is used to resolve permissions if no other role is specified using the `x-hasura-role` header in the GraphQL request. By default, the default role is `user` for signed-in users.
### Allowed Roles
Every user also has a one or more **allowed roles**. Allowed roles are roles that the user is allowed to use to override the default role when making a GraphQL request. To override the default role, add a header `x-hasura-role = <role>` to the GraphQL request.
## Public Access
GraphQL requests from unauthenticated users are resolved using the `public` role.
## Insert permissions
![Insert permissions](/img/graphql/permissions/insert-permissions.png)
Here is a popular approach for insert permission for signed-in users.
1. At the top of the page, click **"insert"** on the **"user"** role.
2. Select **"Without any checks"**.
3. Select the columns you want to allow users to insert.
In our example, we only mark `title`, because the other columns should not be inserted by the user.
We also want every new record's `user_id` value to be set to the ID of the user making the request. We can tell Hasura to do this using **Column presets**.
4. Under **Column presets**, set `user_id` to `x-hasura-user-id`.
Now, users who are signed-in can insert posts. Users can add a title when inserting a post. The post's `id` is automatically generated by the database and the `user_id` is automatically set to the user's id using the `user_id = x-hasura-user-id` column preset.
## Select, Update and Delete Permissions
Select, update, and delete permissions usually follows the same pattern. Here's an example of how to add select permissions:
![Select permissions](/img/platform/permission-select.png)
One of the most common permission requirements is that logged-in users should only be able to read their own data. This is how it can be achieved with Hasura.
One of the most common permission requirements is that signed-in users should only be able to read their own data. This is how to do that:
1. Go to **Hasura Console**
1. Select your table and open the **Permissions** tab
@@ -46,40 +125,14 @@ To further refine this rule, do the following:
Note that if you add columns to your table table later, you must check new columns here to let users read them.
---
## Next Steps
## Insert permissions
Hasura has more in-depth documentation related to permissions that you can learn from:
![Insert permissions](/img/platform/permission-insert.png)
Here is a popular approach for insert permission for logged in users.
1. At the top of the page, click **"insert"** on the **"user"** role.
1. Select **"Without any checks"**.
1. Select the columns you want to allow users to insert.
In our example, we only select `name`, because we want all other other columns to be filled with default values.
We also want every new record's `user_id` value to be set to the ID of the user making the request. We can tell Hasura to do this with **column presets**.
1. Under column presets, set `user_id` to `x-hasura-user-id`.
## Add Permission Variables
You can add extra permission variables in the Nhost console under **Users** and then **Roles and permissions**. These permission variables are then available when creating permissions for your GraphQL API in the Hasura console.
![Permission Variables](/img/platform/permission-variables-preview.svg)
As an example, let's say you add a new permission variable `x-hasura-organisation-id` with path `user.profile.organisation.id`. This means that Nhost Auth will get the value for `x-hasura-organisation-id` by internally generating the following GraphQL query:
```graphql
query {
user(id: "<user-id>") {
profile {
organisation {
id
}
}
}
}
```
- [Authorization / Access control](https://hasura.io/docs/latest/graphql/core/auth/authorization/index/)
- [Access control basics](https://hasura.io/docs/latest/graphql/core/auth/authorization/basics/)
- [Roles & Session variables](https://hasura.io/docs/latest/graphql/core/auth/authorization/roles-variables/)
- [Inherited roles](https://hasura.io/docs/latest/graphql/core/auth/authorization/inherited-roles/)
- [Configuring permission rules](https://hasura.io/docs/latest/graphql/core/auth/authorization/permission-rules/)
- [Access control examples](https://hasura.io/docs/latest/graphql/core/auth/authorization/common-roles-auth-examples/)
- [Multiple column + row permissions for the same role](https://hasura.io/docs/latest/graphql/core/auth/authorization/role-multiple-rules/)

View File

@@ -1,11 +0,0 @@
---
title: 'The Nhost Platform'
sidebar_position: 1
---
- [Database](/platform/database)
- [GraphQL](/platform/graphql)
- [Authentication](/platform/authentication)
- [Storage](/platform/storage)
- [Serverless Functions](/platform/serverless-functions)
- [Nhost](/platform/nhost)

View File

@@ -1,4 +0,0 @@
{
"label": "Nhost",
"position": 7
}

View File

@@ -1,44 +0,0 @@
---
title: 'Environment variables'
sidebar_position: 1
---
Environment variables are key-value pairs configured outside your source code. They are used to store environment-specific values such as API keys.
---
## System environment variables
System environment variables are automatically available in production and local development. The following system environment variables are available:
- `NHOST_ADMIN_SECRET`
- `NHOST_WEBHOOK_SECRET`
- `NHOST_JWT_SECRET`
- `NHOST_BACKEND_URL`
Example values:
```bash
NHOST_ADMIN_SECRET=e7w36ag287qn5qry795f6ymm57qgvqup
NHOST_WEBHOOK_SECRET=ns3sfjgdw4y6zeqthwnnw347dzh8wyj4
NHOST_JWT_SECRET={"type": "HS256", "key": "vumpbe2w2mgaqj5yqfp7dvxu6kywtvsgb68ejpdaqxerea8
jwrsszdp2dhkjxsh4df69pzm3ja6ukedx8ja43zdt6q9kgbgg2w9vh2sedeppukud9a2qzy29v3afdn7m"}
NHOST_BACKEND_URL=https://xxxxxxx.nhost.run
```
---
## Custom environment variables
You can manage your app's environment variables in Nhost Console under **Variables**. When you define a new variable, you can set a different value for production and local development.
When an environment variable is changed, you must deploy your app again for the changes to take effect.
---
## Local environment variables
When developing locally, 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.

View File

@@ -1,36 +0,0 @@
---
title: 'GitHub integration'
sidebar_position: 2
---
You can connect your Nhost app to a GitHub repository. When you do this, any updates you push to your code will automatically be deployed.
---
## Production branch
Nhost will only deploy your production branch. By default this will match the default branch set on GitHub (usually `main`). You can change this option on Nhost Console.
Specifically, the following will be deployed:
- Database migrations
- Hasura metadata
- Serverless functions
---
## Workflow
Create a new Nhost app. Then use [Nhost CLI](/platform/nhost/local-development) to initialize your Nhost app locally.
The workflow is as follows:
1. Make local changes (migrations, metadata, functions)
2. Push changes to GitHub
3. Nhost automatically applies changes to production
**You should always follow this workflow.** Never change things in production directly because that will make the local and production state to be out of sync.
### Local and production branches out of sync
If you do changes directly in your production backend, say you add a new table in production, your migrations in your repository will be out of sync. In such a case, we recommend to start over with `nhost init --remote` to get into a consistent state.

View File

@@ -1,9 +0,0 @@
---
title: 'Overview'
---
Documentation for other platform features:
- [Environment variables](/platform/nhost/environment-variables)
- [GitHub integration](/platform/nhost/github-integration)
- [Local development](/platform/nhost/local-development)

View File

@@ -1,88 +0,0 @@
---
title: 'Nhost CLI'
sidebar_position: 3
---
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
Nhost CLI lets you run Nhost's development environment locally on macOS, Linux and Windows.
---
## Installation
Download and install Nhost CLI for your platform by running this command in your terminal:
```bash
sudo curl -L https://raw.githubusercontent.com/nhost/cli/main/get.sh | bash
```
### Dependencies
- [Git](https://git-scm.com/downloads) must be installed on your system
- [Docker](https://www.docker.com/get-started) must be installed and running when using Nhost CLI
### Function runtimes
To run serverless functions locally, you must have the appropriate runtimes installed on your machine:
- JavaScript and TypeScript functions: `Node.js 14.*`
For Node.js, you will also need to have [express](https://www.npmjs.com/package/express) installed in your repository:
<Tabs>
<TabItem value="npm" label="npm" default>
```bash
npm install --save-dev express @types/express
```
</TabItem>
<TabItem value="yarn" label="Yarn">
```bash
yarn add -D express @types/express
```
</TabItem>
</Tabs>
[Read more about runtimes](/platform/serverless-functions)
---
## Windows support
If you have Windows Subsystem for Linux and `curl` in your Windows environment, you run the command following the instructions above. It will download the `.exe` binary to your current working directory.
If you do not have the above dependencies, download and install the latest release manually from [GitHub releases](https://github.com/nhost/cli/releases).
---
## Apple silicon (M1)
As of late 2021, Hasura does not yet have an M1 optimized version for their GraphQL engine, which Nhost depends on.
If you have a MacBook with an M1 chip, the CLI will automatically change the image used in `nhost/config.yaml` of your app:
```yml
services:
hasura:
image: fedormelexin/graphql-engine-arm64
```
This will run the Hasura GraphQL engine using Rosetta on your machine until an M1 optimized image is launched.
---
## Upgrading
If you already Nhost CLI installed, you can upgrade your installation:
```bash
# sudo permissions needed
sudo nhost upgrade
```
The `upgrade` command was added in `0.5.0`.

View File

@@ -0,0 +1,5 @@
{
"label": "Overview",
"position": 2,
"collapsed": true
}

View File

@@ -0,0 +1,30 @@
---
title: 'Architecture'
sidebar_position: 2
image: /img/og/platform/architecture.png
---
Nhost is a backend as a service built with open source tools to provide developers the general building blocks required to build fantastic digital apps and products.
Here's a diagram of the Nhost stack on a high level:
![Nhost Architecture Diagram](/img/architecture/nhost-diagram.png)
As you see in the image above, Nhost provides endpoints for:
- GraphQL (`/graphql`)
- Authentication (`/auth`)
- Storage (`/storage`)
- Functions (`/functions`)
Data is stored in Postgres and files are stored in S3.
## Open Source
The open source tools used for the full Nhost stack are:
- Database: [Postgres](https://www.postgresql.org/)
- GraphQL: [Hasura](https://github.com/hasura/graphql-engine)
- Authentication: [Hasura Auth](https://github.com/nhost/hasura-auth)
- Storage: [Hasura Storage](https://github.com/nhost/hasura-storage)
- Functions: [Node.js](https://nodejs.org/en/)

View File

@@ -0,0 +1,408 @@
---
title: 'Get Started with Nhost CLI'
sidebar_position: 2
image: /img/og/platform/get-started-with-nhost-cli.png
---
# Get started with Nhost CLI
Nhost's command-line interface (CLI) lets you run a complete Nhost development
environment locally with the following services: PostgreSQL database, Hasura,
Authentication, Storage (MinIO), Serverless Functions, and Emails (Mailhog).
## Installation
### Install the binary globally
To install **Nhost CLI**, run this command from any directory in your terminal:
```bash
sudo curl -L https://raw.githubusercontent.com/nhost/cli/main/get.sh | bash
```
On **MacOS and Linux**, this will install the **Nhost CLI** in `/usr/local/bin`.
If you'd prefer to install to a different location other than `/usr/local/bin`,
set the `INSTALL_PATH` variable accordingly:
```bash
sudo curl -L https://raw.githubusercontent.com/nhost/cli/main/get.sh | INSTALL_PATH=$HOME/bin bash
```
On **Windows**, this will download and extract the binary `nhost.exe` available
under `Assets` of the latest release from the GitHub release page:
https://github.com/nhost/cli/releases.
You can move the executable to a different location and add the path to the
environment variable `PATH` to make `nhost` accessible globally.
Finally, you can check that everything has been successfully installed by
typing:
```bash
nhost version
```
![Nhost CLI Version](/img/architecture/cli/cli-installed.png)
### (Optional) Add shell completion
To add command auto-completion in the shell, you can run the following command:
```bash
nhost completion [shell]
```
This will generate the autocompletion script for `nhost` for the specified shell
(bash, fish, PowerShell, or zsh).
## Prerequisites
### Dependencies
Before using the **Nhost CLI**, make sure you have the following dependencies
installed on your local machine:
- [Git](https://git-scm.com/downloads)
- [Docker](https://www.docker.com/get-started)
:::caution
Docker must be running while using Nhost CLI.
:::
### Nhost CLI login
After installing **Nhost CLI**, you can log in to your Nhost account by running
the following command:
```bash
nhost login
```
This will display a prompt for you to enter your Nhost account credentials
(email/password).
:::info
You can create a Nhost account here: [https://app.nhost.io](https://app.nhost.io/).
:::
![Nhost CLI Login](/img/architecture/cli/cli-login.png)
After successfully logging in, you are authorized to manage your Nhost projects
using the Nhost CLI.
You can also log out at any time by running:
```bash
nhost logout
```
## Set up your project
### 1. Create a new Nhost project
import CreateProject from '@site/src/components/create-nhost-project.mdx'
<CreateProject />
### 2. Create a new GitHub Repository
A typical workflow would also include creating a Github repository for your
Nhost project. It will facilitate your development workflow since Nhost can
integrate with Github to enable continuous deployment.
So, go to your Github account and
[create a new repository](https://github.com/new). You can make your repository
either public or private.
![Create GitHub Repo](/img/architecture/cli/create-github-repo.png)
### 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 new commits to your connected Git repository.
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.
![Connect to GitHub](/img/architecture/cli/connect-repo-step-2.png)
3. **Connect** your GitHub repository.
![Connect to GitHub](/img/architecture/cli/connect-repo-step-3.png)
## Develop locally
## 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 environment in a local environment. That way, you can make changes
and test your code locally before deploying those changes to production.
Initialize your Nhost project locally with the following command:
```bash
nhost init --remote
```
It will prompt you to choose what Nhost project you want to initialize.
![Select Nhost Project](/img/architecture/cli/cli-select-app.png)
Your file system will be populated with the following files and folders:
```
my-nhost-app/
└─ nhost/
├─ config.yaml
├─ emails/
├─ metadata/
├─ migrations/
└─ seeds/
```
Finally, make sure to link your current working directory to your GitHub
repository:
```bash
echo "# my-nhost-app" >> README.md
git init
git add README.md
git commit -m "first commit"
git branch -M main
git remote add origin https://github.com/[github-username]/my-nhost-app.git
git push -u origin main
```
## 2. Start a local development environment
To start a local development environment for your Nhost project, run the following
command:
```bash
nhost up
```
:::caution
Make sure [Docker](https://www.docker.com/get-started) is up and running. Its required for Nhost to work.
:::
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 test the GraphQL API.
The Hasura Console opens automatically at [http://localhost:9695](http://localhost:9695/).
![Hasura Console](/img/architecture/cli/hasura-console.png)
## 3. Make changes
There are three things the Nhost CLI and the GitHub integration track and apply
to production:
- Database Migrations
- Hasura Metadata
- Serverless Functions
:::caution
Settings in `nhost/config.yaml` are not being applied to production. They only work locally for now.
:::
### Database migrations
Database changes are tracked and managed through migrations.
:::tip
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
`messages`, with the following columns:
- `id` (type UUID and default `gen_random_uuid()`),
- `text` (type Text),
- `authorId` (type UUID),
- `createdAt` (type Timestamp and default `now()`)
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 then the **Create Table** button.
![Create Table](/img/architecture/cli/create-table-step-1.png)
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.
![Create Table](/img/architecture/cli/create-table-step-2.png)
Next, click on the **Add Table** button to create the table.
Finally, check out the `migrations/` folder in your project directory. A
migration file has been created automatically to reflect our database changes
and track the new table creation.
The migration was created under `nhost/migrations/default`:
```bash
$ ls -la nhost/migrations/default
total 0
drwxr-xr-x 3 user staff 96 Apr 27 17:06 .
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
```
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
[Deploy your project](#deploy-your-project) section below.
### Hasura metadata
In addition to database schema changes, Nhost also tracks Hasura metadata.
The Hasura metadata track all the actions performed on the console, like
tracking tables/views/functions, creating relationships, configuring
permissions, creating event triggers, and remote schemas.
To demonstrate it, let's add a new permission to our `messages` table for the
`user` role on the `insert` operation. That permission will allow users to
create new messages.
So, open the permissions tab for the `messages` table, type in `user` in the
role cell, and click the edit icon on the `insert` operation:
![Create Table](/img/architecture/cli/permissions-1.png)
To restrict the users to create new messages only for themselves, specify an
`_eq` condition between the `authorId` and the `X-Hasura-User-ID` session
variable, which is passed with each request.
![Create Table](/img/architecture/cli/permissions-2.png)
Then, select the columns the users can define through the GraphQL API, set the
value for the `authorId` column to be equal to the `X-Hasura-User-ID` session
variable, and click **Save Permissions**.
![Create Table](/img/architecture/cli/permissions-3.png)
Finally, check out the `metadata/` folder in your project directory to confirm
that the permission changes we did were tracked locally in your git repository.
In our case, those changes should be tracked in
`nhost/metadata/databases/default/tables/public_messages.yaml`:
```yaml title="nhost/metadata/databases/default/tables/public_messages.yaml"
table:
name: messages
schema: public
insert_permissions:
- permission:
backend_only: false
check:
authorId:
_eq: X-Hasura-User-Id
columns:
- text
set:
authorId: x-hasura-User-Id
role: user
```
### Serverless Functions
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 Serverless Function that will return the
current date-time when called.
First, make sure to install `express`, which is required for serverless
functions to work.
```bash
npm install express
npm install -d @types/node @types/express
```
Then, create a new file named `time.ts` inside the `functions/` folder of your
working directory, and paste the following code:
```ts title="functions/time.ts"
import { Request, Response } from 'express'
export default (req: Request, res: Response) => {
return res.status(200).send(`Hello ${req.query.name}! It's now: ${new Date().toUTCString()}`)
}
```
Every JavaScript and TypeScript file inside the `functions/` folder becomes an
API endpoint.
Locally, the base URL for the serverless functions is
`http://localhost:1337/v1/functions`. Then, the endpoint for each function is
determined by its filename or the name of its dedicated parent directory.
For example, the endpoint for our function is
`http://localhost:1337/v1/functions/time`.
```bash
curl http://localhost:1337/v1/functions/time\?name\=Greg
Hello Greg! It's now: Wed, 27 Apr 2022 18:52:12 GMT
```
## Deploy your project
To deploy your local changes to production, you can commit and push them to
GitHub. As a result, Nhost will automatically pick up the changes in your
repository and apply them to your associated remote Nhost project.
:::caution
Make sure to [connect your Github repository](#3-connect-nhost-project-to-Github) to your Nhost project first.
:::
```bash
git add -A
git commit -m "commit message"
git push
```
To check out your deployment, head over to the **Deployments** tab in your
[Nhost dashboard](https://app.nhost.io).
![Deployments](/img/architecture/cli/deployments.png)
## Get help
To get usage tips and learn more about available commands from within Nhost CLI,
run the following:
```shell
nhost help
```
For more information about a specific command, run the command with the `--help`
flag:
```
nhost init --help
```
If you have additional questions or ideas for new features, you can
[start an issue](https://github.com/nhost/cli/issues) or
[a new discussion](https://github.com/nhost/cli/discussions/new) on Nhost CLIs
open-source repository. You can also
[chat with our team](https://discord.com/invite/9V7Qb2U) on Discord.
Wed love to hear from you!

View File

@@ -0,0 +1,5 @@
{
"label": "Quickstarts",
"position": 3,
"collapsed": false
}

View File

@@ -0,0 +1,702 @@
---
title: 'Quickstart: Next.js'
sidebar_position: 2
image: /img/og/platform/quickstart-nextjs.png
---
import Tabs from '@theme/Tabs'
import TabItem from '@theme/TabItem'
# Quickstart: Next.js
## Introduction
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/)
- Instant GraphQL API: [Hasura](https://hasura.io/)
- 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 sign
in to access a protected dashboard and update their profile information.
## Prerequisites
Before getting started, let's make sure that your development environment is
ready.
You'll need **Node.js** version 12 or later: [install it from here](https://nodejs.org/en/).
## Project setup
### Create a new Nhost app
import CreateApp from '@site/src/components/create-nhost-project.mdx'
<CreateApp />
:::info
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
### Create a Next.js app
The simplest way to create a new Next.js application is by using the tool called
`create-next-app`, which bootstraps a Next.js app for you without the hassle of
configuring everything yourself.
So, open your terminal, and run the following command:
```bash
npx create-next-app my-nhost-app --example "https://github.com/nhost/quickstart-nextjs"
```
:::info
This command uses an [existing template](https://github.com/nhost/quickstart-nextjs), through the `--example` flag, which already contains the React components and pages we'll use for this guide.
:::
You can now `cd` into your project directory:
```bash
cd my-nhost-app
```
And run the development server with the following command:
<Tabs groupId="package-manager">
<TabItem value="npm" label="npm" default>
```bash
npm run dev
```
</TabItem>
<TabItem value="yarn" label="Yarn">
```bash
yarn dev
```
</TabItem>
</Tabs>
If everything is working fine, your Next.js development server should be running
on port 3000. Open [http://localhost:3000](http://localhost:3000) from your
browser to check this out.
### Configure Nhost with Next.js
To work with Nhost from within our Next.js app, we'll use the
[Next.js SDK](https://github.com/nhost/nhost/tree/main/packages/nextjs) provided
by Nhost. It's a wrapper around the
[Nhost React SDK](https://github.com/nhost/nhost/tree/main/packages/react) which
gives us a way to interact with our Nhost backend using React hooks.
You can install the Nhost Next.js SDK with:
<Tabs groupId="package-manager">
<TabItem value="npm" label="npm" default>
```bash
npm install @nhost/react @nhost/nextjs graphql
```
</TabItem>
<TabItem value="yarn" label="Yarn">
```bash
yarn add @nhost/react @nhost/nextjs graphql
```
</TabItem>
</Tabs>
Next, open your `_app.js` file as we'll now configure Nhost inside our app.
The Nhost Next.js SDK comes with a React provider named `NhostNextProvider` that
makes the authentication state and all the provided React hooks available in our
application.
Use the following code to instantiate a new Nhost client and link it to your
Nhost backend:
```jsx title="pages/_app.js"
import { UserProvider } from '../UserProvider';
// highlight-start
import { NhostNextProvider, NhostClient } from '@nhost/nextjs';
// highlight-end
// highlight-start
const nhost = new NhostClient({
subdomain: process.env.NEXT_PUBLIC_NHOST_SUBDOMAIN || '',
region: process.env.NEXT_PUBLIC_NHOST_REGION || ''
});
// highlight-end
function MyApp({ Component, pageProps }) {
return (
{/* highlight-next-line */}
<NhostNextProvider nhost={nhost} initial={pageProps.nhostSession}>
<UserProvider>
{/* ... */}
</UserProvider>
{/* highlight-next-line */}
</NhostNextProvider>
);
}
```
Finally, store the environment variables for `subdomain` and `region` in `.env.development`:
```yaml title=".env.development"
NEXT_PUBLIC_NHOST_SUBDOMAIN=[subdomain]
NEXT_PUBLIC_NHOST_REGION=[region]
```
You find your Nhost project's `subdomain` and `region` in the [project overview](https://app.nhost.io):
![Project Overview](/img/quickstarts/app-dashboard.png)
:::caution
Don't forget to restart your Next.js server after saving your `.env.development`
file to load your new environment variable.
:::
## Build the app
### Add authentication
#### 1. Sign-up
The next step is to allow our users to authenticate into our application.
Let's start with implementing the sign-up process.
For that, we'll use the `useSignUpEmailPassword` hook provided by the Nhost
Next.js SDK within our `SignUp` component.
So, open up the corresponding file from your project, and use the following
code:
```jsx title="components/SignUp.js"
import styles from '../styles/components/SignUp.module.css'
import { useState } from 'react'
import { useRouter } from 'next/router'
import { useSignUpEmailPassword } from '@nhost/nextjs'
import Link from 'next/link'
import Image from 'next/image'
import Input from './Input'
import Spinner from './Spinner'
const SignUp = () => {
const [firstName, setFirstName] = useState('')
const [lastName, setLastName] = useState('')
const [email, setEmail] = useState('')
const [password, setPassword] = useState('')
const router = useRouter()
const { signUpEmailPassword, isLoading, isSuccess, needsEmailVerification, isError, error } =
useSignUpEmailPassword()
const handleOnSubmit = async (e) => {
e.preventDefault()
await signUpEmailPassword(email, password, {
displayName: `${firstName} ${lastName}`.trim(),
metadata: {
firstName,
lastName
}
})
}
if (isSuccess) {
router.push('/')
return null
}
const disableForm = isLoading || needsEmailVerification
return (
<div className={styles.container}>
<div className={styles.card}>
<div className={styles['logo-wrapper']}>
<Image src="/logo.svg" alt="logo" layout="fill" objectFit="contain" />
</div>
{needsEmailVerification ? (
<p className={styles['verification-text']}>
Please check your mailbox and follow the verification link to verify your email.
</p>
) : (
<form onSubmit={handleOnSubmit} className={styles.form}>
<div className={styles['input-group']}>
<Input
label="First name"
value={firstName}
onChange={(e) => setFirstName(e.target.value)}
disabled={disableForm}
required
/>
<Input
label="Last name"
value={lastName}
onChange={(e) => setLastName(e.target.value)}
disabled={disableForm}
required
/>
</div>
<Input
type="email"
label="Email address"
value={email}
onChange={(e) => setEmail(e.target.value)}
disabled={disableForm}
required
/>
<Input
type="password"
label="Create password"
value={password}
onChange={(e) => setPassword(e.target.value)}
disabled={disableForm}
required
/>
<button type="submit" disabled={disableForm} className={styles.button}>
{isLoading ? <Spinner size="sm" /> : 'Create account'}
</button>
{isError ? <p className={styles['error-text']}>{error?.message}</p> : null}
</form>
)}
</div>
<p className={styles.text}>
Already have an account?{' '}
<Link href="/sign-in">
<a className={styles.link}>Sign in</a>
</Link>
</p>
</div>
)
}
export default SignUp
```
By default, the user must verify his email address before fully signing up. You can change this setting from your Nhost dashboard.
#### 2. Sign-in
Now that new users can sign up for our application, let's see how to allow
existing users to sign in with email and password.
For that, we will use the Nhost hook named `useSignInEmailPassword` inside our
`SignIn` component the same way we did with our `SignUp` component. So, here's
what your component should look like after applying the changes for the sign-in
logic:
```jsx title="components/SignIn.js"
import styles from '../styles/components/SignIn.module.css'
import { useState } from 'react'
import { useRouter } from 'next/router'
import { useSignInEmailPassword } from '@nhost/nextjs'
import Link from 'next/link'
import Image from 'next/image'
import Input from './Input'
import Spinner from './Spinner'
const SignIn = () => {
const [email, setEmail] = useState('')
const [password, setPassword] = useState('')
const router = useRouter()
const { signInEmailPassword, isLoading, isSuccess, needsEmailVerification, isError, error } =
useSignInEmailPassword()
const handleOnSubmit = async (e) => {
e.preventDefault()
await signInEmailPassword(email, password)
}
if (isSuccess) {
router.push('/')
return null
}
const disableForm = isLoading || needsEmailVerification
return (
<div className={styles.container}>
<div className={styles.card}>
<div className={styles['logo-wrapper']}>
<Image src="/logo.svg" alt="logo" layout="fill" objectFit="contain" />
</div>
{needsEmailVerification ? (
<p className={styles['verification-text']}>
Please check your mailbox and follow the verification link to verify your email.
</p>
) : (
<>
<form onSubmit={handleOnSubmit} className={styles.form}>
<Input
type="email"
label="Email address"
value={email}
onChange={(e) => setEmail(e.target.value)}
disabled={disableForm}
required
/>
<Input
type="password"
label="Password"
value={password}
onChange={(e) => setPassword(e.target.value)}
disabled={disableForm}
required
/>
<button type="submit" disabled={disableForm} className={styles.button}>
{isLoading ? <Spinner size="sm" /> : 'Sign in'}
</button>
{isError ? <p className={styles['error-text']}>{error?.message}</p> : null}
</form>
</>
)}
</div>
<p className={styles.text}>
No account yet?{' '}
<Link href="/sign-up">
<a className={styles.link}>Sign up</a>
</Link>
</p>
</div>
)
}
export default SignIn
```
#### 3. Sign-out
Finally, to allow the users to sign out from the app, we can use the Nhost
`useSignOut` hook:
```jsx title="components/Layout.js"
import { useSignOut } from '@nhost/nextjs'
const Layout = ({ children = null }) => {
const { signOut } = useSignOut()
const menuItems = [
//..
{
label: 'Logout',
onClick: signOut,
icon: LogoutIcon
}
]
//...
}
```
### Protect routes
Now that we have implemented authentication, we can easily decide who can access
certain parts of our application.
In our case, we'll only allow authenticated users to have access to the `/` and
`/profile` routes. All the other users should be redirected to the `/sign-in`
page if they try to access those routes.
To do so, we can check the authentication status of the current user using the
Nhost SDK by creating a
[high-order component](https://reactjs.org/docs/higher-order-components.html):
```jsx title="withAuth.js"
import styles from './styles/pages/ProtectedRoute.module.css'
import { useRouter } from 'next/router'
import { useAuthenticationStatus } from '@nhost/nextjs'
import Spinner from './components/Spinner'
export default function withAuth(Component) {
return function AuthProtected(props) {
const router = useRouter()
const { isLoading, isAuthenticated } = useAuthenticationStatus()
if (isLoading) {
return (
<div className={styles.container}>
<Spinner />
</div>
)
}
if (!isAuthenticated) {
router.push('/sign-in')
return null
}
return <Component {...props} />
}
}
```
Then, wrap our Next.js pages, `index.js` and `profile.js`, with it:
<Tabs
defaultValue="index"
values={[
{label: 'pages/index.js', value: 'index'},
{label: 'pages/profile.js', value: 'profile'},
]}>
<TabItem value="index">
```js
import withAuth from '../withAuth'
const Home = () => {
//...
}
export default withAuth(Home)
```
</TabItem>
<TabItem value="profile">
```js
import withAuth from '../withAuth'
const Profile = () => {
//...
}
export default withAuth(Profile)
```
</TabItem>
</Tabs>
### Retrieve user data
Finally, let's display the information of the authenticated user throughout his
dashboard to make the app more personalized.
Getting the current authenticated user data is quite easy. We
can use the `useUserData` hook provided by Nhost to do it.
So, open the `UserProvider.js` file and use this hook like so:
```js
import React, { useContext } from 'react'
// highlight-next-line
import { useUserData } from '@nhost/nextjs'
const UserContext = React.createContext(null)
export function UserProvider({ children = null }) {
// highlight-next-line
const user = useUserData()
return <UserContext.Provider value={{ user }}>{children}</UserContext.Provider>
}
export function useUserContext() {
return useContext(UserContext)
}
```
That's it! The JSX code for rendering the user data (email, display name, etc.)
is already included in your components as part of the example repository you've
bootstrapped at the beginning of this guide.
### Update user data
Nhost provides a GraphQL API through Hasura so that we can query and mutate our
data instantly.
In this tutorial, we'll use the
[Apollo GraphQL client](https://www.apollographql.com/) for interacting with
this GraphQL API.
So, start by installing the following dependencies:
<Tabs groupId="package-manager">
<TabItem value="npm" label="npm" default>
```bash
npm install @nhost/react-apollo @apollo/client
```
</TabItem>
<TabItem value="yarn" label="Yarn">
```bash
yarn add @nhost/react-apollo @apollo/client
```
</TabItem>
</Tabs>
Then, add the `NhostApolloProvider` from `@nhost/react-apollo` into your
`_app_.js` file.
```jsx title="pages/_app.js"
import { NhostApolloProvider } from '@nhost/react-apollo'
function MyApp({ Component, pageProps }) {
return (
<NhostNextProvider nhost={nhost} initial={pageProps.nhostSession}>
<NhostApolloProvider nhost={nhost}>{/* ... */}</NhostApolloProvider>
</NhostNextProvider>
)
}
```
From there, we can construct our GraphQL query and use the Apollo `useMutation`
hook to execute that query when the user submits the form from the profile page:
```js title="pages/profile.js"
import { gql, useMutation } from '@apollo/client'
import { toast } from 'react-hot-toast'
const UPDATE_USER_MUTATION = gql`
mutation ($id: uuid!, $displayName: String!, $metadata: jsonb) {
updateUser(pk_columns: { id: $id }, _set: { displayName: $displayName, metadata: $metadata }) {
id
displayName
metadata
}
}
`
const Profile = () => {
const [mutateUser, { loading: updatingProfile }] = useMutation(UPDATE_USER_MUTATION)
const updateUserProfile = async (e) => {
e.preventDefault()
try {
await mutateUser({
variables: {
id: user.id,
displayName: `${firstName} ${lastName}`.trim(),
metadata: {
firstName,
lastName
}
}
})
toast.success('Updated successfully', { id: 'updateProfile' })
} catch (error) {
toast.error('Unable to update profile', { id: 'updateProfile' })
}
}
//...
}
```
Finally, since Hasura has an **allow nothing by default** policy, and we haven't
set any permissions yet, our GraphQL mutations would fail.
So, open the Hasura console from the **Data** tab of your project from [your Nhost dashboard](https://app.nhost.io/). Then, go to the **permissions** tab of the `users` table, type in `user` in the role
cell, and click the edit icon on the `select` operation:
![Hasura users permissions](/img/quickstarts/hasura-permissions-1.png)
To restrict the user to read his data only, specify a condition with the
user's ID and the `X-Hasura-User-ID` session variable, which is passed with each
requests.
![Hasura users permissions](/img/quickstarts/hasura-permissions-2.png)
Next, select the columns you'd like the users to have access to, and click
**Save Permissions**.
![Hasura users permissions](/img/quickstarts/hasura-permissions-3.png)
Repeat the same steps on the `update` operation for the `user` role to allow
users to update their `displayName` and `metadata` only.
Finally, to add caching, synchronizing, and updating server state in your Next.js app, let's refactor the user data fetching by using the Apollo client and our GraphQL API instead.
So, first add the following GraphQL query to retrieve the current user data from the `UserProvider.js` file:
```js title="UserProvider.js"
import { gql } from '@apollo/client'
const GET_USER_QUERY = gql`
query GetUser($id: uuid!) {
user(id: $id) {
id
email
displayName
metadata
avatarUrl
}
}
`
export function UserProvider() {
//...
}
```
Then, replace the `useUserData` hook with the `useUserId` hook to retrieve the current user's ID only.
```js title="UserProvider.js"
import { useUserId } from '@nhost/nextjs'
export function UserProvider() {
const id = useUserId()
//...
}
```
Finally, we can run our GraphQL query using the `useQuery` hook and the current user's ID.
```jsx title="UserProvider.js"
// highlight-next-line
import { gql, useQuery } from '@apollo/client'
export function UserProvider({ children = null }) {
const id = useUserId()
// highlight-start
const { loading, error, data } = useQuery(GET_USER_QUERY, {
variables: { id },
skip: !id
})
const user = data?.user
// highlight-end
// highlight-start
if (error) {
return <p>Something went wrong. Try to refresh the page.</p>
}
if (loading) {
return null
}
// highlight-end
return <UserContext.Provider value={{ user }}>{children}</UserContext.Provider>
}
```
You now have a fully functional Next.js application. Congratulations!
## Next Steps
- Did you enjoy Nhost? Give us a star ⭐ on [Github](https://github.com/nhost/nhost). Thank you!
- Check out our more in-depth [examples](https://github.com/nhost/nhost/tree/main/examples).
- Build your next app with [Nhost](https://app.nhost.io/)!

View File

@@ -0,0 +1,677 @@
---
title: 'Quickstart: React'
sidebar_position: 1
image: /img/og/platform/quickstart-react.png
---
import Tabs from '@theme/Tabs'
import TabItem from '@theme/TabItem'
# Quickstart: React
## Introduction
This quickstart guide provides the steps you need to build a simple React app
powered by Nhost for the backend. It includes:
- Database: [PostgreSQL](https://www.postgresql.org/)
- Instant GraphQL API: [Hasura](https://hasura.io/)
- 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
in to access a protected dashboard and update their profile information.
## Prerequisites
Before getting started, let's make sure that your development environment is
ready.
You'll need **Node.js** version 14 or later: [install it from here](https://nodejs.org/en/).
## Project setup
### Create a new Nhost project
import CreateProject from '@site/src/components/create-nhost-project.mdx'
<CreateProject />
:::info
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
### Create a React app
The simplest way to create a new React application is by using the tool called
`create-react-app`, which bootstraps a React app for you without the hassle of
configuring everything yourself.
So, open your terminal, and run the following command:
```bash
npx create-react-app my-nhost-app --template nhost-quickstart
```
:::info
This command uses an [existing template](https://github.com/nhost/cra-template-nhost-quickstart), through the `--template` flag, which already contains the React components and pages we'll use for this guide.
:::
You can now `cd` into your project directory:
```bash
cd my-nhost-app
```
And run the development server with the following command:
<Tabs groupId="package-manager">
<TabItem value="npm" label="npm" default>
```bash
npm start
```
</TabItem>
<TabItem value="yarn" label="Yarn">
```bash
yarn start
```
</TabItem>
</Tabs>
If everything is working fine, your React development server should be running
on port 3000. Open [http://localhost:3000](http://localhost:3000) from your
browser to check this out.
### Configure Nhost with React
To work with Nhost from within our React app, we'll use the
[React SDK](https://github.com/nhost/nhost/tree/main/packages/react) provided
by Nhost. It's a wrapper around the
[Nhost JavaScript SDK](https://github.com/nhost/nhost/tree/main/packages/nhost-js) which
gives us a way to interact with our Nhost backend using React hooks.
You can install the Nhost React SDK with:
<Tabs groupId="package-manager">
<TabItem value="npm" label="npm" default>
```bash
npm install @nhost/react graphql
```
</TabItem>
<TabItem value="yarn" label="Yarn">
```bash
yarn add @nhost/react graphql
```
</TabItem>
</Tabs>
Next, open your `App.js` file as we'll now configure Nhost inside our app.
The Nhost React SDK comes with a React provider named `NhostReactProvider` that
makes the authentication state and all the provided React hooks available in our
application.
Use the following code to instantiate a new Nhost client and link it to your
Nhost backend:
```jsx title="src/App.js"
import { NhostClient, NhostReactProvider } from '@nhost/react'
const nhost = new NhostClient({
subdomain: process.env.REACT_APP_NHOST_SUBDOMAIN,
region: process.env.REACT_APP_NHOST_REGION
})
function App() {
return (
<NhostReactProvider nhost={nhost}>
<BrowserRouter>{/* ... */}</BrowserRouter>
</NhostReactProvider>
)
}
export default App
```
Finally, make sure to create an environment variable named
`REACT_APP_NHOST_SUBDOMAIN` and `REACT_APP_NHOST_REGION` to store your Nhost domain details:
```yaml title=".env.local"
REACT_APP_NHOST_SUBDOMAIN=[subdomain]
REACT_APP_NHOST_REGION=[region]
```
You find your Nhost project's `subdomain` and `region` in the [project overview](https://app.nhost.io):
![Project Overview](/img/quickstarts/app-dashboard.png)
:::caution
Don't forget to restart your React server after saving your `.env.local`
file to load your new environment variable.
:::
## Build the app
### Add authentication
#### 1. Sign-up
The next step is to allow our users to authenticate into our application.
Let's start with implementing the sign-up process.
For that, we'll use the `useSignUpEmailPassword` hook provided by the Nhost
React SDK within our `SignUp` component.
So, open up the corresponding file from your project, and use the following
code:
```jsx title="src/components/SignUp.js"
import styles from '../styles/components/SignUp.module.css'
import { useState } from 'react'
import { useSignUpEmailPassword } from '@nhost/react'
import { Link, Navigate } from 'react-router-dom'
import Input from './Input'
import Spinner from './Spinner'
const SignUp = () => {
const [firstName, setFirstName] = useState('')
const [lastName, setLastName] = useState('')
const [email, setEmail] = useState('')
const [password, setPassword] = useState('')
const { signUpEmailPassword, isLoading, isSuccess, needsEmailVerification, isError, error } =
useSignUpEmailPassword()
const handleOnSubmit = (e) => {
e.preventDefault()
signUpEmailPassword(email, password, {
displayName: `${firstName} ${lastName}`.trim(),
metadata: {
firstName,
lastName
}
})
}
if (isSuccess) {
return <Navigate to="/" replace={true} />
}
const disableForm = isLoading || needsEmailVerification
return (
<div className={styles.container}>
<div className={styles.card}>
<div className={styles['logo-wrapper']}>
<img src={process.env.PUBLIC_URL + 'logo.svg'} alt="logo" />
</div>
{needsEmailVerification ? (
<p className={styles['verification-text']}>
Please check your mailbox and follow the verification link to verify your email.
</p>
) : (
<form onSubmit={handleOnSubmit} className={styles.form}>
<div className={styles['input-group']}>
<Input
label="First name"
value={firstName}
onChange={(e) => setFirstName(e.target.value)}
disabled={disableForm}
required
/>
<Input
label="Last name"
value={lastName}
onChange={(e) => setLastName(e.target.value)}
disabled={disableForm}
required
/>
</div>
<Input
type="email"
label="Email address"
value={email}
onChange={(e) => setEmail(e.target.value)}
disabled={disableForm}
required
/>
<Input
type="password"
label="Create password"
value={password}
onChange={(e) => setPassword(e.target.value)}
disabled={disableForm}
required
/>
<button type="submit" disabled={disableForm} className={styles.button}>
{isLoading ? <Spinner size="sm" /> : 'Create account'}
</button>
{isError ? <p className={styles['error-text']}>{error?.message}</p> : null}
</form>
)}
</div>
<p className={styles.text}>
Already have an account?{' '}
<Link to="/sign-in" className={styles.link}>
Sign in
</Link>
</p>
</div>
)
}
export default SignUp
```
By default, the user must verify his email address before fully signing up. You can change this setting from your Nhost dashboard.
#### 2. Sign-in
Now that new users can sign up for our application, let's see how to allow
existing users to sign in with email and password.
For that, we will use the Nhost hook named `useSignInEmailPassword` inside our
`SignIn` component the same way we did with our `SignUp` component. So, here's
what your component should look like after applying the changes for the sign-in
logic:
```jsx title="src/components/SignIn.js"
import styles from '../styles/components/SignIn.module.css'
import { useState } from 'react'
import { useSignInEmailPassword } from '@nhost/react'
import { Link, Navigate } from 'react-router-dom'
import Input from './Input'
import Spinner from './Spinner'
const SignIn = () => {
const [email, setEmail] = useState('')
const [password, setPassword] = useState('')
const { signInEmailPassword, isLoading, isSuccess, needsEmailVerification, isError, error } =
useSignInEmailPassword()
const handleOnSubmit = (e) => {
e.preventDefault()
signInEmailPassword(email, password)
}
if (isSuccess) {
return <Navigate to="/" replace={true} />
}
const disableForm = isLoading || needsEmailVerification
return (
<div className={styles.container}>
<div className={styles.card}>
<div className={styles['logo-wrapper']}>
<img src={process.env.PUBLIC_URL + 'logo.svg'} alt="logo" />
</div>
{needsEmailVerification ? (
<p className={styles['verification-text']}>
Please check your mailbox and follow the verification link to verify your email.
</p>
) : (
<form onSubmit={handleOnSubmit} className={styles.form}>
<Input
type="email"
label="Email address"
value={email}
onChange={(e) => setEmail(e.target.value)}
disabled={disableForm}
required
/>
<Input
type="password"
label="Password"
value={password}
onChange={(e) => setPassword(e.target.value)}
disabled={disableForm}
required
/>
<button type="submit" disabled={disableForm} className={styles.button}>
{isLoading ? <Spinner size="sm" /> : 'Sign in'}
</button>
{isError ? <p className={styles['error-text']}>{error?.message}</p> : null}
</form>
)}
</div>
<p className={styles.text}>
No account yet?{' '}
<Link to="/sign-up" className={styles.link}>
Sign up
</Link>
</p>
</div>
)
}
export default SignIn
```
#### 3. Sign-out
Finally, to allow the users to sign out from the app, we can use the Nhost
`useSignOut` hook:
```jsx title="src/components/Layout.js"
import { useSignOut } from '@nhost/react'
const Layout = () => {
const { signOut } = useSignOut()
const menuItems = [
//..
{
label: 'Logout',
onClick: signOut,
icon: LogoutIcon
}
]
//...
}
```
### Protect routes
Now that we have implemented authentication, we can easily decide who can access
certain parts of our application.
In our case, we'll only allow authenticated users to have access to the `/` and
`/profile` routes. All the other users should be redirected to the `/sign-in`
page if they try to access those routes.
To do so, we can create a wrapper component (`ProtectedRoute`) to check the authentication status of the current user using the Nhost SDK:
```jsx title="src/components/ProtectedRoute.js"
import styles from '../styles/components/ProtectedRoute.module.css'
import { useAuthenticationStatus } from '@nhost/react'
import { Navigate, useLocation } from 'react-router-dom'
import Spinner from './Spinner'
const ProtectedRoute = ({ children }) => {
const { isAuthenticated, isLoading } = useAuthenticationStatus()
const location = useLocation()
if (isLoading) {
return (
<div className={styles.container}>
<Spinner />
</div>
)
}
if (!isAuthenticated) {
return <Navigate to="/sign-in" state={{ from: location }} replace />
}
return children
}
export default ProtectedRoute
```
Then, we can use a [layout route](https://reactrouter.com/docs/en/v6/getting-started/concepts#layout-routes) in our `App.js` file, to wrap the `ProtectedRoute` component around the routes we want to protect:
```jsx title="src/App.js"
import ProtectedRoute from './components/ProtectedRoute'
function App() {
return (
<NhostReactProvider nhost={nhost}>
<BrowserRouter>
<Routes>
<Route path="sign-up" element={<SignUp />} />
<Route path="sign-in" element={<SignIn />} />
<Route
path="/"
// highlight-start
element={
<ProtectedRoute>
<Layout />
</ProtectedRoute>
}
// highlight-end
>
<Route index element={<Dashboard />} />
<Route path="profile" element={<Profile />} />
</Route>
</Routes>
</BrowserRouter>
</NhostReactProvider>
)
}
```
### Retrieve user data
Finally, let's display the information of the authenticated user throughout his
dashboard to make the app more personalized.
Getting the current authenticated user data is quite easy. Indeed, we
can use the `useUserData` hook provided by Nhost to do it.
So, open the `components/Layout.js` file and use this hook like so:
```js
import { useUserData } from '@nhost/react'
const Layout = () => {
const user = useUserData()
//...
}
```
That's it! The JSX code for rendering the user data (email, display name, etc.)
is already included in your components as part of the template you've
bootstraped at the beginning of this guide.
### Update user data
Nhost provides a GraphQL API through Hasura so that we can query and mutate our
data instantly.
In this tutorial, we'll use the
[Apollo GraphQL client](https://www.apollographql.com/) for interacting with
this GraphQL API.
So, start by installing the following dependencies:
<Tabs groupId="package-manager">
<TabItem value="npm" label="npm" default>
```bash
npm install @nhost/react-apollo @apollo/client
```
</TabItem>
<TabItem value="yarn" label="Yarn">
```bash
yarn add @nhost/react-apollo @apollo/client
```
</TabItem>
</Tabs>
Then, add the `NhostApolloProvider` from `@nhost/react-apollo` into your
`App.js` file.
```jsx title="src/App.js"
import { NhostApolloProvider } from '@nhost/react-apollo'
function App() {
return (
<NhostReactProvider nhost={nhost}>
<NhostApolloProvider nhost={nhost}>{/* ... */}</NhostApolloProvider>
</NhostReactProvider>
)
}
```
From there, we can construct our GraphQL query and use the Apollo `useMutation`
hook to execute that query when the user submits the form from the profile page:
```js title="src/pages/Profile.js"
import { gql, useMutation } from '@apollo/client'
import { toast } from 'react-hot-toast'
const UPDATE_USER_MUTATION = gql`
mutation ($id: uuid!, $displayName: String!, $metadata: jsonb) {
updateUser(pk_columns: { id: $id }, _set: { displayName: $displayName, metadata: $metadata }) {
id
displayName
metadata
}
}
`
const Profile = () => {
const [mutateUser, { loading: updatingProfile }] = useMutation(UPDATE_USER_MUTATION)
const updateUserProfile = async (e) => {
e.preventDefault()
try {
await mutateUser({
variables: {
id: user.id,
displayName: `${firstName} ${lastName}`.trim(),
metadata: {
firstName,
lastName
}
}
})
toast.success('Updated successfully', { id: 'updateProfile' })
} catch (error) {
toast.error('Unable to update profile', { id: 'updateProfile' })
}
}
//...
}
```
Finally, since Hasura has an **allow nothing by default** policy, and we haven't
set any permissions yet, our GraphQL mutations would fail.
So, open the Hasura console from the **Data** tab of your project from [your Nhost dashboard](https://app.nhost.io/). Then, go to the **permissions** tab of the `users` table, type in `user` in the role
cell, and click the edit icon on the `select` operation:
![Hasura users permissions](/img/quickstarts/hasura-permissions-1.png)
To restrict the user to read his own data only, specify a condition with the
user's ID and the `X-Hasura-User-ID` session variable, which is passed with each
requests.
![Hasura users permissions](/img/quickstarts/hasura-permissions-2.png)
Next, select the columns you'd like the users to have access to, and click
**Save Permissions**.
![Hasura users permissions](/img/quickstarts/hasura-permissions-3.png)
Repeat the same steps on the `update` operation for the `user` role to allow
users to update their `displayName` and `metadata` only.
Finally, to add caching, synchronizing, and updating server state in your React app, let's refactor the user data fetching using the Apollo client and our GraphQL API instead.
So, first add the following GraphQL query to retrieve the current user data from the `Layout` component:
```js title="src/components/Layout.js"
import { gql } from '@apollo/client'
const GET_USER_QUERY = gql`
query GetUser($id: uuid!) {
user(id: $id) {
id
email
displayName
metadata
avatarUrl
}
}
`
const Layout = () => {
//...
}
```
Then, replace the `useUserData` hook with the `useUserId` hook to retrieve the current user's ID.
```js title="src/components/Layout.js"
import { useUserId } from '@nhost/react'
const Layout = () => {
const id = useUserId()
//...
}
```
Finally, we can run our GraphQL query using the `useQuery` hook and the current user's ID.
```jsx title="src/components/Layout.js"
// highlight-next-line
import { gql, useQuery } from '@apollo/client'
const Layout = () => {
const id = useUserId()
// highlight-start
const { loading, error, data } = useQuery(GET_USER_QUERY, {
variables: { id },
skip: !id
})
const user = data?.user
// highlight-end
//...
return (
<div>
<header>{/* ... */}</header>
<main className={styles.main}>
<div className={styles['main-container']}>
{/* highlight-start */}
{error ? (
<p>Something went wrong. Try to refresh the page.</p>
) : !loading ? (
<Outlet context={{ user }} />
) : null}
{/* highlight-end */}
</div>
</main>
</div>
)
}
```
You now have a fully functional React application. Congratulations!
## Next Steps
- Did you enjoy Nhost? Give us a star ⭐ on [Github](https://github.com/nhost/nhost). Thank you!
- Check out our more in-depth [examples](https://github.com/nhost/nhost/tree/main/examples).
- Build your next app with [Nhost](https://app.nhost.io/)!

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