Compare commits

...

237 Commits

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

Sorry if this is duplicated.
2022-07-02 19:19:25 +02:00
Johan Eliasson
a5f02e8056 workding 2022-07-02 08:58:19 +02:00
Johan Eliasson
aeb85a1e01 u 2022-07-02 08:54:42 +02:00
Johan Eliasson
821912e23e Merge pull request #781 from nhost/docs/subdomain-readmes
docs: update to subdomains in readmes
2022-07-02 08:11:54 +02:00
Pierre-Louis Mercereau
8608a78eaf docs: update readmes to subdomains 2022-07-01 22:57:08 +02:00
Pilou
2d2da4f6e0 Merge pull request #778 from nhost/plmercereau-patch-1
Update docker compose readme
2022-07-01 11:18:19 +02:00
Pilou
19d7262b05 Update README.md 2022-07-01 08:07:37 +02:00
Johan Eliasson
1c750bd652 Merge pull request #769 from nhost/codegen-example
Example: Adding codegen example from blog post
2022-06-30 13:45:52 +02:00
Pierre-Louis Mercereau
8a3943a942 build: fix lockfile 2022-06-30 11:34:50 +02:00
Johan Eliasson
62385a7866 Merge branch 'main' into codegen-example 2022-06-30 11:00:23 +02:00
Pilou
9e21de3819 Merge pull request #771 from nhost/changeset-release/main
chore: update versions
2022-06-29 21:55:36 +02:00
Pierre-Louis Mercereau
c101a26ce5 build: clean lockfile, and build all packages 2022-06-29 17:55:15 +02:00
Pierre-Louis Mercereau
21fa83d115 build: adapt turborepo pipeline 2022-06-29 17:23:00 +02:00
Pierre-Louis Mercereau
522839d8f7 chore: keep original lockfile 2022-06-29 17:19:24 +02:00
Pierre-Louis Mercereau
87aad599f3 chore: update lockfile 2022-06-29 17:17:01 +02:00
Pierre-Louis Mercereau
5b097e635d chore: remove verbose 2022-06-29 17:10:43 +02:00
Pierre-Louis Mercereau
bfdcacd5a3 smaller eslintrc 2022-06-29 17:04:09 +02:00
Pierre-Louis Mercereau
dcb9055475 chore: remove console.log 2022-06-29 16:58:14 +02:00
Pierre-Louis Mercereau
6f0bf3d67c docs: typoe 2022-06-29 16:54:24 +02:00
Pierre-Louis Mercereau
3c96c561a0 chore: remove unused dependency 2022-06-29 16:45:33 +02:00
Pierre-Louis Mercereau
3d319364f3 build: sync nhost services versions 2022-06-29 16:44:15 +02:00
Johan Eliasson
80468ac3ac merge main and pnpm install 2022-06-29 14:54:37 +02:00
Johan Eliasson
d03653f1fd config update 2022-06-29 14:46:40 +02:00
Pierre-Louis Mercereau
a7f3599fb1 chore: unbump peer dep versions 2022-06-29 14:21:20 +02:00
github-actions[bot]
c789102189 chore: update versions 2022-06-29 12:11:21 +00:00
Pilou
b638173181 Merge pull request #768 from nhost/storage-improvements
Storage fixes and improvements
2022-06-29 14:10:11 +02:00
Pierre-Louis Mercereau
d65df02adb docs: format inline example 2022-06-29 14:08:49 +02:00
Johan Eliasson
5dff7ad5d3 README update 2022-06-29 13:40:29 +02:00
Johan Eliasson
9263bea2ae clear 2022-06-29 13:32:04 +02:00
Johan Eliasson
4f994b536e correct parameters 2022-06-29 13:15:13 +02:00
Pierre-Louis Mercereau
4f9287562e chore: changeset 2022-06-29 12:16:39 +02:00
Pierre-Louis Mercereau
58f82f9aad fix: adapt to new signature 2022-06-29 11:56:05 +02:00
Johan Eliasson
c907021313 update 2022-06-29 11:10:34 +02:00
Johan Eliasson
12a218b12c importing Nhost providers 2022-06-29 10:55:43 +02:00
Pierre-Louis Mercereau
196156ff93 build: use vite 2022-06-29 10:15:12 +02:00
Johan Eliasson
28ca032f70 adding public permissions 2022-06-29 08:26:41 +02:00
Johan Eliasson
38462c45b6 Merge pull request #762 from nhost/docs-seed
docs: Added seed data information
2022-06-29 08:22:38 +02:00
Johan Eliasson
8e03ed43b7 prepending with zeros 2022-06-29 08:21:31 +02:00
Johan Eliasson
333292ab89 adding codegen example from blog post 2022-06-29 08:17:42 +02:00
Pierre-Louis Mercereau
b4d52debff chore: wip 2022-06-28 18:49:38 +02:00
Pilou
287e48a51a Merge pull request #766 from nhost/docs/example-on-vercel
fix: force redirectTo link
2022-06-28 16:58:12 +02:00
Pierre-Louis Mercereau
9370e06b68 fix: simplify 2022-06-28 16:53:19 +02:00
Pierre-Louis Mercereau
d5b775c630 fix: force redirectTo link 2022-06-28 16:46:12 +02:00
Pilou
ea8e1df8da Merge pull request #743 from nhost/docs/example-on-vercel
React-apollo example on Vercel
2022-06-28 16:23:06 +02:00
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
Pierre-Louis Mercereau
a898a19ffa docs: add functions to docker-compose example 2022-06-27 10:46:13 +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
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
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
Pierre-Louis Mercereau
d20bfe3431 refactor: move files machines to hasura-storage-js, and prepare tests 2022-06-13 09:29:09 +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
479a2ed08d Merge remote-tracking branch 'origin/main' into feat/file-upload 2022-06-08 21:52:21 +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
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
Pierre-Louis Mercereau
2443399cdc Merge branch 'main' into feat/file-upload 2022-05-31 20:35:43 +02:00
Pierre-Louis Mercereau
de81942fb2 phrasing 2022-05-31 08:21:10 +02:00
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
Pierre-Louis Mercereau
20f8fe9eb4 correct inline doc 2022-05-30 22:48:56 +02:00
Pierre-Louis Mercereau
6f6044c49c forbid clearing list when uploading 2022-05-30 22:45:24 +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
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
Pierre-Louis Mercereau
e821af279a error, cancellation, simplification 2022-05-30 17:36:27 +02:00
Pierre-Louis Mercereau
1d3469a455 Merge branch 'main' into feat/file-upload 2022-05-30 15:58:37 +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
42dc93100c feat(wip): file upload machines, hooks and example 2022-05-26 22:28:44 +02:00
339 changed files with 11261 additions and 1508 deletions

View File

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

View File

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

View File

@@ -147,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/gdangelo">
<img src="https://avatars.githubusercontent.com/u/4352286?v=4" width="100;" alt="gdangelo"/>
@@ -174,15 +167,15 @@ Here are some ways of contributing to making Nhost better:
<br />
<sub><b>Guido Curcio</b></sub>
</a>
</td></tr>
<tr>
</td>
<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></tr>
<tr>
<td align="center">
<a href="https://github.com/sebagudelo">
<img src="https://avatars.githubusercontent.com/u/43288271?v=4" width="100;" alt="sebagudelo"/>
@@ -204,21 +197,35 @@ Here are some ways of contributing to making Nhost better:
<sub><b>Pratim</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/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/GavanWilhite">
<img src="https://avatars.githubusercontent.com/u/2085119?v=4" width="100;" alt="GavanWilhite"/>
<br />
<sub><b>Gavan Wilhite</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/FuzzyReason">
<img src="https://avatars.githubusercontent.com/u/62517920?v=4" width="100;" alt="FuzzyReason"/>
<br />
<sub><b>Vadim Smirnov</b></sub>
</a>
</td>
</td></tr>
<tr>
<td align="center">
<a href="https://github.com/macmac49">
<img src="https://avatars.githubusercontent.com/u/831190?v=4" width="100;" alt="macmac49"/>
<br />
<sub><b>Macmac49</b></sub>
</a>
</td></tr>
<tr>
</td>
<td align="center">
<a href="https://github.com/subhendukundu">
<img src="https://avatars.githubusercontent.com/u/20059141?v=4" width="100;" alt="subhendukundu"/>
@@ -253,13 +260,6 @@ Here are some ways of contributing to making Nhost better:
<br />
<sub><b>Filip Hájek</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/GavanWilhite">
<img src="https://avatars.githubusercontent.com/u/2085119?v=4" width="100;" alt="GavanWilhite"/>
<br />
<sub><b>Gavan Wilhite</b></sub>
</a>
</td></tr>
<tr>
<td align="center">
@@ -391,6 +391,13 @@ Here are some ways of contributing to making Nhost better:
</a>
</td></tr>
<tr>
<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"/>
@@ -412,6 +419,13 @@ Here are some ways of contributing to making Nhost better:
<sub><b>Tapas Adhikary</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/uulwake">
<img src="https://avatars.githubusercontent.com/u/22399181?v=4" width="100;" alt="uulwake"/>
<br />
<sub><b>Ulrich Wake</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/komninoschat">
<img src="https://avatars.githubusercontent.com/u/29049104?v=4" width="100;" alt="komninoschat"/>

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

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

8
config/.lintstagedrc.js Normal file
View File

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

View File

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

View File

@@ -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 with your Nhost App.
<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 in your app:
```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 with your Nhost App.
<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 in your app:
```js
nhost.auth.signIn({
provider: 'discord'
})
```

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 with your Nhost App.
<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 in your app:
```js
nhost.auth.signIn({
provider: 'twitch'
})
```

View File

@@ -35,6 +35,18 @@ nhost.auth.signIn({
Users are redirected to your Nhost app's **client URL** by default. By default, your Nhost app's client URL is set to `http://localhost:3000`. You can change the value of your client URL in the Nhost console by going to **Users****Authentication Settings****Client URL**.
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.

View File

@@ -81,6 +81,18 @@ nhost up
Hasura Console starts automatically and your Nhost app is running locally with the backend URL: `http://localhost:1337`.
## Subdomain and Region
Use `localhost:1337` as the `subdomain`, and skip `region` when using the CLI and the [JavaScript SDK](/reference/javascript):
```
import { NhostClient } from '@nhost/nhost-js'
const nhost = new NhostClient({
subdomain: 'localhost:1337',
})
```
## Emails
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.

View File

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

View File

@@ -132,7 +132,8 @@ import { NhostNextProvider, NhostClient } from '@nhost/nextjs';
// highlight-start
const nhost = new NhostClient({
backendUrl: process.env.NEXT_PUBLIC_NHOST_BACKEND_URL || '',
subdomain: process.env.NEXT_PUBLIC_NHOST_SUBDOMAIN || '',
region: process.env.NEXT_PUBLIC_NHOST_REGION || ''
});
// highlight-end
@@ -149,16 +150,16 @@ function MyApp({ Component, pageProps }) {
}
```
Finally, make sure to create an environment variable named
`NEXT_PUBLIC_NHOST_BACKEND_URL` to store your Nhost backend URL:
Finally, store the environment variables for `subdomain` and `region` in `.env.development`:
```yaml title=".env.development"
NEXT_PUBLIC_NHOST_BACKEND_URL=YOUR_NHOST_BACKEND_URL
NEXT_PUBLIC_NHOST_SUBDOMAIN=YOUR_NHOST_APP_SUBDOMAIN
NEXT_PUBLIC_NHOST_REGION=YOUR_NHOST_APP_REGION
```
You can find your Nhost backend URL for your project from [your dashboard](https://app.nhost.io) as shown below:
You find your Nhost app's subdomain and region in [the app dashboard](https://app.nhost.io):
![Nhost Backend URL](/img/quickstarts/app-dashboard.png)
![Nhost App Dashboard](/img/quickstarts/app-dashboard.png)
:::caution
Don't forget to restart your Next.js server after saving your `.env.development`

View File

@@ -128,7 +128,8 @@ Nhost backend:
import { NhostClient, NhostReactProvider } from '@nhost/react'
const nhost = new NhostClient({
backendUrl: process.env.REACT_APP_NHOST_BACKEND_URL || ''
subdomain: process.env.REACT_APP_NHOST_SUBDOMAIN,
region: process.env.REACT_APP_NHOST_REGION
})
function App() {
@@ -143,15 +144,16 @@ export default App
```
Finally, make sure to create an environment variable named
`REACT_APP_NHOST_BACKEND_URL` to store your Nhost backend URL:
`REACT_APP_NHOST_SUBDOMAIN` and `REACT_APP_NHOST_REGION` to store your Nhost domain details:
```yaml title=".env.local"
REACT_APP_NHOST_BACKEND_URL=YOUR_NHOST_BACKEND_URL
REACT_APP_NHOST_SUBDOMAIN=YOUR_NHOST_APP_SUBDOMAIN
REACT_APP_NHOST_REGION=YOUR_NHOST_APP_REGION
```
You can find your Nhost backend URL for your project from [your dashboard](https://app.nhost.io) as shown below:
You find your Nhost app's subdomain and region in [the app dashboard](https://app.nhost.io):
![Nhost Backend URL](/img/quickstarts/app-dashboard.png)
![Nhost App Dashboard](/img/quickstarts/app-dashboard.png)
:::caution
Don't forget to restart your React server after saving your `.env.local`

View File

@@ -136,7 +136,8 @@ import { NhostClient } from '@nhost/nhost-js'
// highlight-start
const nhostClient = new NhostClient({
backendUrl: process.env.NHOST_BACKEND_URL
subdomain: process.env.NHOST_SUBDOMAIN
region: process.env.NHOST_REGION
})
// highlight-end
@@ -175,16 +176,16 @@ const App = () => (
That prop avoids having an additional request to fetch the current user.
Next, make sure to create an environment variable named
`NHOST_BACKEND_URL` to store your Nhost backend URL:
Next, store the environment variables for `subdomain` and `region` in `.env`:
```yaml title=".env"
NHOST_BACKEND_URL=YOUR_NHOST_BACKEND_URL
NHOST_SUBDOMAIN=YOUR_NHOST_APP_SUBDOMAIN
NHOST_REGION=YOUR_NHOST_APP_REGION
```
You can find your Nhost backend URL for your project from [your dashboard](https://app.nhost.io) as shown below:
You find your Nhost app's subdomain and region in [the app dashboard](https://app.nhost.io):
![Nhost Backend URL](/img/quickstarts/app-dashboard.png)
![Nhost App Dashboard](/img/quickstarts/app-dashboard.png)
Finally, we need to customize the GraphQL Endpoint for our RedwoodJS app. Indeed, by default, RedwoodJS provides a built-in GraphQL server under the `api` side. However, as we already have our own GraphQL server through Nhost and Hasura, we do not need it.
@@ -194,7 +195,7 @@ So, open the RedwoodJS configuration file, `redwood.toml`, and change the GraphQ
[web]
apiUrl = "/.redwood/functions"
# highlight-next-line
apiGraphQLUrl = "${NHOST_BACKEND_URL}/v1/graphql"
apiGraphQLUrl = "https://${NHOST_SUBDOMAIN}.graphql.${NHOST_REGION}.nhost.run/v1"
```
:::caution

View File

@@ -153,7 +153,8 @@ import 'uno.css'
// highlight-start
const nhost = new NhostClient({
backendUrl: import.meta.env.VITE_NHOST_URL
subdomain: import.meta.env.VITE_NHOST_SUBDOMAIN
region: import.meta.env.VITE_NHOST_REGION
})
// highlight-end
@@ -170,16 +171,16 @@ app
app.mount('#app')
```
Finally, make sure to create an environment variable named
`VITE_NHOST_URL` to store your Nhost backend URL:
Finally, store the environment variables for `subdomain` and `region` in `.env`:
```bash title=".env"
VITE_NHOST_URL=YOUR_NHOST_BACKEND_URL
```yaml title=".env.development"
VITE_NHOST_SUBDOMAIN=YOUR_NHOST_APP_SUBDOMAIN
VITE_NHOST_REGION=YOUR_NHOST_APP_REGION
```
You can find your Nhost backend URL for your project from [your dashboard](https://app.nhost.io) as shown below:
You find your Nhost app's subdomain and region in [the app dashboard](https://app.nhost.io):
![Nhost Backend URL](/img/quickstarts/app-dashboard.png)
![Nhost App Dashboard](/img/quickstarts/app-dashboard.png)
## Build the app

View File

@@ -7,7 +7,7 @@ Launch the development environment for your app. Once the environment is up, the
- Apply database migrations.
- Apply the Hasura metadata.
- Apply seed data.
- Apply [seed data](/platform/database#seed-data).
```bash
nhost up

View File

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

View File

@@ -4,7 +4,7 @@ title: signIn()
sidebar_label: signIn()
slug: /reference/javascript/auth/sign-in
description: Use `nhost.auth.signIn` to sign in a user using email and password, passwordless (email or sms) or an external provider. `signIn` can be used to sign in a user in various ways depending on the parameters.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L145
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L146
---
# `signIn()`

View File

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

View File

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

View File

@@ -4,7 +4,7 @@ title: changePassword()
sidebar_label: changePassword()
slug: /reference/javascript/auth/change-password
description: Use `nhost.auth.changePassword` to change the password for the user. The old password is not needed.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L262
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L263
---
# `changePassword()`

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -4,7 +4,7 @@ title: NhostClient
sidebar_label: NhostClient
description: No description provided.
slug: /reference/javascript/nhost-js/nhost-client
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/nhost-js/src/core/nhost-client.ts#L9
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/nhost-js/src/core/nhost-client.ts#L8
---
# `NhostClient`

View File

@@ -0,0 +1,10 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: createFileUploadMachine()
sidebar_label: createFileUploadMachine()
slug: /reference/javascript/storage/create-file-upload-machine
description: No description provided.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-storage-js/src/packages/hasura-storage-js/src/machines/file-upload.ts#L36
---
# `createFileUploadMachine()`

View File

@@ -0,0 +1,10 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: createMultipleFilesUploadMachine()
sidebar_label: createMultipleFilesUploadMachine()
slug: /reference/javascript/storage/create-multiple-files-upload-machine
description: No description provided.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-storage-js/src/packages/hasura-storage-js/src/machines/multiple-files-upload.ts#L37
---
# `createMultipleFilesUploadMachine()`

View File

@@ -4,7 +4,7 @@ title: upload()
sidebar_label: upload()
slug: /reference/javascript/storage/upload
description: Use `nhost.storage.upload` to upload a file. The `file` must be of type [`File`](https://developer.mozilla.org/en-US/docs/Web/API/File).
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-storage-js/src/hasura-storage-client.ts#L52
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-storage-js/src/packages/hasura-storage-js/src/hasura-storage-client.ts#L52
---
# `upload()`

View File

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

View File

@@ -4,7 +4,7 @@ title: getPublicUrl()
sidebar_label: getPublicUrl()
slug: /reference/javascript/storage/get-public-url
description: Use `nhost.storage.getPublicUrl` to get the public URL of a file. The public URL can be used for un-authenticated users to access files. To access public files the `public` role must have permissions to select the file in the `storage.files` table.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-storage-js/src/hasura-storage-client.ts#L88
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-storage-js/src/packages/hasura-storage-js/src/hasura-storage-client.ts#L88
---
# `getPublicUrl()`

View File

@@ -4,7 +4,7 @@ title: getPresignedUrl()
sidebar_label: getPresignedUrl()
slug: /reference/javascript/storage/get-presigned-url
description: Use `nhost.storage.getPresignedUrl` to get a presigned URL of a file. To get a presigned URL the user must have permission to select the file in the `storage.files` table.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-storage-js/src/hasura-storage-client.ts#L110
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-storage-js/src/packages/hasura-storage-js/src/hasura-storage-client.ts#L110
---
# `getPresignedUrl()`

View File

@@ -4,7 +4,7 @@ title: delete()
sidebar_label: delete()
slug: /reference/javascript/storage/delete
description: Use `nhost.storage.delete` to delete a file. To delete a file the user must have permissions to delete the file in the `storage.files` table. Deleting the file using `nhost.storage.delete()` will delete both the file and its metadata.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-storage-js/src/hasura-storage-client.ts#L135
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-storage-js/src/packages/hasura-storage-js/src/hasura-storage-client.ts#L135
---
# `delete()`

View File

@@ -4,7 +4,7 @@ title: setAccessToken()
sidebar_label: setAccessToken()
slug: /reference/javascript/storage/set-access-token
description: Use `nhost.storage.setAccessToken` to a set an access token to be used in subsequent storage requests. Note that if you're signin in users with `nhost.auth.signIn()` the access token will be set automatically.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-storage-js/src/hasura-storage-client.ts#L156
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-storage-js/src/packages/hasura-storage-js/src/hasura-storage-client.ts#L156
---
# `setAccessToken()`

View File

@@ -4,7 +4,7 @@ title: setAdminSecret()
sidebar_label: setAdminSecret()
slug: /reference/javascript/storage/set-admin-secret
description: Use `nhost.storage.adminSecret` to set the admin secret to be used for subsequent storage requests. This is useful if you want to run storage in "admin mode".
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-storage-js/src/hasura-storage-client.ts#L174
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-storage-js/src/packages/hasura-storage-js/src/hasura-storage-client.ts#L174
---
# `setAdminSecret()`

View File

@@ -4,7 +4,7 @@ title: HasuraStorageClient
sidebar_label: Storage
description: No description provided.
slug: /reference/javascript/storage
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-storage-js/src/hasura-storage-client.ts#L25
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-storage-js/src/packages/hasura-storage-js/src/hasura-storage-client.ts#L25
---
# `HasuraStorageClient`

View File

@@ -0,0 +1,32 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: uploadFilePromise()
sidebar_label: uploadFilePromise()
slug: /reference/javascript/storage/upload-file-promise
description: No description provided.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-storage-js/src/packages/hasura-storage-js/src/promises/file-upload.ts#L40
---
# `uploadFilePromise()`
## Parameters
---
**<span className="parameter-name">nhost</span>** <span className="optional-status">required</span> [`NhostClientReturnType`](/reference/docgen/javascript/storage/types/nhost-client-return-type)
| Property | Type | Required | Notes |
| :-------------------------------------------------------------------------------------------- | :----------------- | :------: | :---- |
| <span className="parameter-name"><span className="light-grey">nhost.</span>storage</span> | `{ url: string }` | ✔️ | |
| <span className="parameter-name"><span className="light-grey">nhost.</span>auth</span> | `HasuraAuthClient` | ✔️ | |
| <span className="parameter-name"><span className="light-grey">nhost.</span>adminSecret</span> | `string` | | |
---
**<span className="parameter-name">interpreter</span>** <span className="optional-status">required</span> `ActorRefWithDeprecatedState<FileUploadContext, { type: "ADD", file: File, id: string, bucketId: string, name: string } | { type: "UPLOAD", url: string, file: File, id: string, bucketId: string, name: string, accessToken: string, adminSecret: string } | { type: "UPLOAD_PROGRESS", progress: number, loaded: number, additions: number } | { type: "UPLOAD_DONE", id: string, bucketId: string } | { type: "UPLOAD_ERROR", error: ErrorPayload } | { type: "CANCEL" } | { type: "DESTROY" }, { value: any, context: FileUploadContext }, ResolveTypegenMeta<Typegen0, { type: "ADD", file: File, id: string, bucketId: string, name: string } | { type: "UPLOAD", url: string, file: File, id: string, bucketId: string, name: string, accessToken: string, adminSecret: string } | { type: "UPLOAD_PROGRESS", progress: number, loaded: number, additions: number } | { type: "UPLOAD_DONE", id: string, bucketId: string } | { type: "UPLOAD_ERROR", error: ErrorPayload } | { type: "CANCEL" } | { type: "DESTROY" }, BaseActionObject, ServiceMap>>` | `Interpreter<FileUploadContext, any, { type: "ADD", file: File, id: string, bucketId: string, name: string } | { type: "UPLOAD", url: string, file: File, id: string, bucketId: string, name: string, accessToken: string, adminSecret: string } | { type: "UPLOAD_PROGRESS", progress: number, loaded: number, additions: number } | { type: "UPLOAD_DONE", id: string, bucketId: string } | { type: "UPLOAD_ERROR", error: ErrorPayload } | { type: "CANCEL" } | { type: "DESTROY" }, { value: any, context: FileUploadContext }, ResolveTypegenMeta<Typegen0, { type: "ADD", file: File, id: string, bucketId: string, name: string } | { type: "UPLOAD", url: string, file: File, id: string, bucketId: string, name: string, accessToken: string, adminSecret: string } | { type: "UPLOAD_PROGRESS", progress: number, loaded: number, additions: number } | { type: "UPLOAD_DONE", id: string, bucketId: string } | { type: "UPLOAD_ERROR", error: ErrorPayload } | { type: "CANCEL" } | { type: "DESTROY" }, BaseActionObject, ServiceMap>>`
---
**<span className="parameter-name">params</span>** <span className="optional-status">required</span> `Partial<StorageUploadParams>`
---

View File

@@ -0,0 +1,37 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: uploadMultipleFilesPromise()
sidebar_label: uploadMultipleFilesPromise()
slug: /reference/javascript/storage/upload-multiple-files-promise
description: No description provided.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-storage-js/src/packages/hasura-storage-js/src/promises/multiple-files-upload.ts#L46
---
# `uploadMultipleFilesPromise()`
## Parameters
---
**<span className="parameter-name">nhost</span>** <span className="optional-status">required</span> [`NhostClientReturnType`](/reference/docgen/javascript/storage/types/nhost-client-return-type)
| Property | Type | Required | Notes |
| :-------------------------------------------------------------------------------------------- | :----------------- | :------: | :---- |
| <span className="parameter-name"><span className="light-grey">nhost.</span>auth</span> | `HasuraAuthClient` | ✔️ | |
| <span className="parameter-name"><span className="light-grey">nhost.</span>storage</span> | `{ url: string }` | ✔️ | |
| <span className="parameter-name"><span className="light-grey">nhost.</span>adminSecret</span> | `string` | | |
---
**<span className="parameter-name">service</span>** <span className="optional-status">required</span> `Interpreter<MultipleFilesUploadContext, any, { type: "ADD", files: AnyFileList, bucketId: string } | { type: "UPLOAD", url: string, files: AnyFileList, bucketId: string, accessToken: string, adminSecret: string } | { type: "UPLOAD_PROGRESS", additions: number } | { type: "UPLOAD_DONE" } | { type: "UPLOAD_ERROR" } | { type: "CANCEL" } | { type: "REMOVE" } | { type: "CLEAR" }, { value: any, context: MultipleFilesUploadContext }, ResolveTypegenMeta<Typegen0, { type: "ADD", files: AnyFileList, bucketId: string } | { type: "UPLOAD", url: string, files: AnyFileList, bucketId: string, accessToken: string, adminSecret: string } | { type: "UPLOAD_PROGRESS", additions: number } | { type: "UPLOAD_DONE" } | { type: "UPLOAD_ERROR" } | { type: "CANCEL" } | { type: "REMOVE" } | { type: "CLEAR" }, BaseActionObject, ServiceMap>>`
---
**<span className="parameter-name">params</span>** <span className="optional-status">optional</span> [`UploadMultipleFilesActionParams`](/reference/docgen/javascript/storage/types/upload-multiple-files-action-params)
| Property | Type | Required | Notes |
| :------------------------------------------------------------------------------------------ | :------------------------------------------------------------------------ | :------: | :---- |
| <span className="parameter-name"><span className="light-grey">params.</span>bucketId</span> | `string` | | |
| <span className="parameter-name"><span className="light-grey">params.</span>files</span> | [`AnyFileList`](/reference/docgen/javascript/storage/types/any-file-list) | | |
---

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -0,0 +1,10 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: FileItemRef
sidebar_label: FileItemRef
description: No description provided.
displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-storage-js/src/packages/hasura-storage-js/src/machines/multiple-files-upload.ts#L7
---
# `FileItemRef`

View File

@@ -0,0 +1,21 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: FileUploadContext
sidebar_label: FileUploadContext
description: No description provided.
displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-storage-js/src/packages/hasura-storage-js/src/machines/file-upload.ts#L6
---
# `FileUploadContext`
```ts
type FileUploadContext = () => {
progress: number | null
loaded: number
error: ErrorPayload | null
id: string
bucketId: string
file: File
}
```

View File

@@ -0,0 +1,35 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: FileUploadEvents
sidebar_label: FileUploadEvents
description: No description provided.
displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-storage-js/src/packages/hasura-storage-js/src/machines/file-upload.ts#L15
---
# `FileUploadEvents`
```ts
type FileUploadEvents =
| { type: 'ADD'; file: File; id: string; bucketId: string; name: string }
| {
type: 'UPLOAD'
url: string
file: File
id: string
bucketId: string
name: string
accessToken: string
adminSecret: string
}
| {
type: 'UPLOAD_PROGRESS'
progress: number
loaded: number
additions: number
}
| { type: 'UPLOAD_DONE'; id: string; bucketId: string }
| { type: 'UPLOAD_ERROR'; error: ErrorPayload }
| { type: 'CANCEL' }
| { type: 'DESTROY' }
```

View File

@@ -0,0 +1,10 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: FileUploadMachine
sidebar_label: FileUploadMachine
description: No description provided.
displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-storage-js/src/packages/hasura-storage-js/src/machines/file-upload.ts#L35
---
# `FileUploadMachine`

View File

@@ -0,0 +1,68 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: FileUploadState
sidebar_label: FileUploadState
description: No description provided.
displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-storage-js/src/packages/hasura-storage-js/src/promises/file-upload.ts#L38
---
# `FileUploadState`
## Parameters
---
**<span className="parameter-name">isError</span>** <span className="optional-status">required</span> `boolean`
**`@returns`**
`true` if an error occurred
**`@depreacted`**
use `!isSuccess` or `!!error` instead
---
**<span className="parameter-name">error</span>** <span className="optional-status">required</span> `null` | `ErrorPayload`
Provides details about the error
---
**<span className="parameter-name">isUploading</span>** <span className="optional-status">required</span> `boolean`
Returns `true` when the file is being uploaded.
---
**<span className="parameter-name">progress</span>** <span className="optional-status">required</span> `null` | `number`
Returns the progress of the upload, from 0 to 100. Returns null if the upload has not started yet.
---
**<span className="parameter-name">isUploaded</span>** <span className="optional-status">required</span> `boolean`
Returns `true` when the file has been successfully uploaded.
---
**<span className="parameter-name">id</span>** <span className="optional-status">optional</span> `string`
Returns the id of the file.
---
**<span className="parameter-name">bucketId</span>** <span className="optional-status">optional</span> `string`
Returns the bucket id.
---
**<span className="parameter-name">name</span>** <span className="optional-status">optional</span> `string`
Returns the name of the file.
---

View File

@@ -0,0 +1,32 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: MultipleFilesHandlerResult
sidebar_label: MultipleFilesHandlerResult
description: No description provided.
displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-storage-js/src/packages/hasura-storage-js/src/promises/multiple-files-upload.ts#L17
---
# `MultipleFilesHandlerResult`
## Parameters
---
**<span className="parameter-name">files</span>** <span className="optional-status">required</span> `Array<ActorRefWithDeprecatedState<FileUploadContext, { type: "ADD", file: File, id: string, bucketId: string, name: string } | { type: "UPLOAD", url: string, file: File, id: string, bucketId: string, name: string, accessToken: string, adminSecret: string } | { type: "UPLOAD_PROGRESS", progress: number, loaded: number, additions: number } | { type: "UPLOAD_DONE", id: string, bucketId: string } | { type: "UPLOAD_ERROR", error: ErrorPayload } | { type: "CANCEL" } | { type: "DESTROY" }, { value: any, context: FileUploadContext }, ResolveTypegenMeta<Typegen0, { type: "ADD", file: File, id: string, bucketId: string, name: string } | { type: "UPLOAD", url: string, file: File, id: string, bucketId: string, name: string, accessToken: string, adminSecret: string } | { type: "UPLOAD_PROGRESS", progress: number, loaded: number, additions: number } | { type: "UPLOAD_DONE", id: string, bucketId: string } | { type: "UPLOAD_ERROR", error: ErrorPayload } | { type: "CANCEL" } | { type: "DESTROY" }, BaseActionObject, ServiceMap>>>`
The list of file uploads. The properties can be accessed through `item.getSnapshot()` of with the `useFileUploadItem` hook.
---
**<span className="parameter-name">isError</span>** <span className="optional-status">required</span> `boolean`
Returns `true` when all upload request are processed, but at least one of them has failed.
---
**<span className="parameter-name">errors</span>** <span className="optional-status">required</span> `Array<ActorRefWithDeprecatedState<FileUploadContext, { type: "ADD", file: File, id: string, bucketId: string, name: string } | { type: "UPLOAD", url: string, file: File, id: string, bucketId: string, name: string, accessToken: string, adminSecret: string } | { type: "UPLOAD_PROGRESS", progress: number, loaded: number, additions: number } | { type: "UPLOAD_DONE", id: string, bucketId: string } | { type: "UPLOAD_ERROR", error: ErrorPayload } | { type: "CANCEL" } | { type: "DESTROY" }, { value: any, context: FileUploadContext }, ResolveTypegenMeta<Typegen0, { type: "ADD", file: File, id: string, bucketId: string, name: string } | { type: "UPLOAD", url: string, file: File, id: string, bucketId: string, name: string, accessToken: string, adminSecret: string } | { type: "UPLOAD_PROGRESS", progress: number, loaded: number, additions: number } | { type: "UPLOAD_DONE", id: string, bucketId: string } | { type: "UPLOAD_ERROR", error: ErrorPayload } | { type: "CANCEL" } | { type: "DESTROY" }, BaseActionObject, ServiceMap>>>`
Returns the list of file uploads that have failed
---

View File

@@ -0,0 +1,14 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: MultipleFilesUploadContext
sidebar_label: MultipleFilesUploadContext
description: No description provided.
displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-storage-js/src/packages/hasura-storage-js/src/machines/multiple-files-upload.ts#L11
---
# `MultipleFilesUploadContext`
```ts
type MultipleFilesUploadContext = () => { progress: number | null, files: Array<[FileItemRef](/reference/docgen/javascript/storage/types/file-item-ref)>, loaded: number, total: number }
```

View File

@@ -0,0 +1,29 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: MultipleFilesUploadEvents
sidebar_label: MultipleFilesUploadEvents
description: No description provided.
displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-storage-js/src/packages/hasura-storage-js/src/machines/multiple-files-upload.ts#L18
---
# `MultipleFilesUploadEvents`
```ts
type MultipleFilesUploadEvents =
| { type: 'ADD'; files: AnyFileList; bucketId: string }
| {
type: 'UPLOAD'
url: string
files: AnyFileList
bucketId: string
accessToken: string
adminSecret: string
}
| { type: 'UPLOAD_PROGRESS'; additions: number }
| { type: 'UPLOAD_DONE' }
| { type: 'UPLOAD_ERROR' }
| { type: 'CANCEL' }
| { type: 'REMOVE' }
| { type: 'CLEAR' }
```

View File

@@ -0,0 +1,10 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: MultipleFilesUploadMachine
sidebar_label: MultipleFilesUploadMachine
description: No description provided.
displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-storage-js/src/packages/hasura-storage-js/src/machines/multiple-files-upload.ts#L35
---
# `MultipleFilesUploadMachine`

View File

@@ -0,0 +1,50 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: MultipleFilesUploadState
sidebar_label: MultipleFilesUploadState
description: No description provided.
displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-storage-js/src/packages/hasura-storage-js/src/promises/multiple-files-upload.ts#L32
---
# `MultipleFilesUploadState`
## Parameters
---
**<span className="parameter-name">isUploading</span>** <span className="optional-status">required</span> `boolean`
Returns `true` when the files are being uploaded.
---
**<span className="parameter-name">progress</span>** <span className="optional-status">required</span> `null` | `number`
Returns the overall progress of the upload, from 0 to 100. Returns null if the upload has not started yet.
---
**<span className="parameter-name">files</span>** <span className="optional-status">required</span> `Array<ActorRefWithDeprecatedState<FileUploadContext, { type: "ADD", file: File, id: string, bucketId: string, name: string } | { type: "UPLOAD", url: string, file: File, id: string, bucketId: string, name: string, accessToken: string, adminSecret: string } | { type: "UPLOAD_PROGRESS", progress: number, loaded: number, additions: number } | { type: "UPLOAD_DONE", id: string, bucketId: string } | { type: "UPLOAD_ERROR", error: ErrorPayload } | { type: "CANCEL" } | { type: "DESTROY" }, { value: any, context: FileUploadContext }, ResolveTypegenMeta<Typegen0, { type: "ADD", file: File, id: string, bucketId: string, name: string } | { type: "UPLOAD", url: string, file: File, id: string, bucketId: string, name: string, accessToken: string, adminSecret: string } | { type: "UPLOAD_PROGRESS", progress: number, loaded: number, additions: number } | { type: "UPLOAD_DONE", id: string, bucketId: string } | { type: "UPLOAD_ERROR", error: ErrorPayload } | { type: "CANCEL" } | { type: "DESTROY" }, BaseActionObject, ServiceMap>>>`
The list of file uploads. The properties can be accessed through `item.getSnapshot()` of with the `useFileUploadItem` hook.
---
**<span className="parameter-name">isError</span>** <span className="optional-status">required</span> `boolean`
Returns `true` when all upload request are processed, but at least one of them has failed.
---
**<span className="parameter-name">errors</span>** <span className="optional-status">required</span> `Array<ActorRefWithDeprecatedState<FileUploadContext, { type: "ADD", file: File, id: string, bucketId: string, name: string } | { type: "UPLOAD", url: string, file: File, id: string, bucketId: string, name: string, accessToken: string, adminSecret: string } | { type: "UPLOAD_PROGRESS", progress: number, loaded: number, additions: number } | { type: "UPLOAD_DONE", id: string, bucketId: string } | { type: "UPLOAD_ERROR", error: ErrorPayload } | { type: "CANCEL" } | { type: "DESTROY" }, { value: any, context: FileUploadContext }, ResolveTypegenMeta<Typegen0, { type: "ADD", file: File, id: string, bucketId: string, name: string } | { type: "UPLOAD", url: string, file: File, id: string, bucketId: string, name: string, accessToken: string, adminSecret: string } | { type: "UPLOAD_PROGRESS", progress: number, loaded: number, additions: number } | { type: "UPLOAD_DONE", id: string, bucketId: string } | { type: "UPLOAD_ERROR", error: ErrorPayload } | { type: "CANCEL" } | { type: "DESTROY" }, BaseActionObject, ServiceMap>>>`
Returns the list of file uploads that have failed
---
**<span className="parameter-name">isUploaded</span>** <span className="optional-status">required</span> `boolean`
Returns `true` when all the files have been successfully uploaded.
---

View File

@@ -0,0 +1,26 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: MultipleUploadProgressState
sidebar_label: MultipleUploadProgressState
description: No description provided.
displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-storage-js/src/packages/hasura-storage-js/src/promises/multiple-files-upload.ts#L6
---
# `MultipleUploadProgressState`
## Parameters
---
**<span className="parameter-name">isUploading</span>** <span className="optional-status">required</span> `boolean`
Returns `true` when the files are being uploaded.
---
**<span className="parameter-name">progress</span>** <span className="optional-status">required</span> `null` | `number`
Returns the overall progress of the upload, from 0 to 100. Returns null if the upload has not started yet.
---

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -0,0 +1,56 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: UploadFileHandlerResult
sidebar_label: UploadFileHandlerResult
description: No description provided.
displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-storage-js/src/packages/hasura-storage-js/src/promises/file-upload.ts#L19
---
# `UploadFileHandlerResult`
## Parameters
---
**<span className="parameter-name">isError</span>** <span className="optional-status">required</span> `boolean`
**`@returns`**
`true` if an error occurred
**`@depreacted`**
use `!isSuccess` or `!!error` instead
---
**<span className="parameter-name">error</span>** <span className="optional-status">required</span> `null` | `ErrorPayload`
Provides details about the error
---
**<span className="parameter-name">isUploaded</span>** <span className="optional-status">required</span> `boolean`
Returns `true` when the file has been successfully uploaded.
---
**<span className="parameter-name">id</span>** <span className="optional-status">optional</span> `string`
Returns the id of the file.
---
**<span className="parameter-name">bucketId</span>** <span className="optional-status">optional</span> `string`
Returns the bucket id.
---
**<span className="parameter-name">name</span>** <span className="optional-status">optional</span> `string`
Returns the name of the file.
---

View File

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

View File

@@ -0,0 +1,14 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: UploadMultipleFilesActionParams
sidebar_label: UploadMultipleFilesActionParams
description: No description provided.
displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-storage-js/src/packages/hasura-storage-js/src/promises/multiple-files-upload.ts#L41
---
# `UploadMultipleFilesActionParams`
```ts
type UploadMultipleFilesActionParams = () => { bucketId: string, files: [AnyFileList](/reference/docgen/javascript/storage/types/any-file-list) }
```

View File

@@ -0,0 +1,26 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: UploadProgressState
sidebar_label: UploadProgressState
description: No description provided.
displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-storage-js/src/packages/hasura-storage-js/src/promises/file-upload.ts#L8
---
# `UploadProgressState`
## Parameters
---
**<span className="parameter-name">isUploading</span>** <span className="optional-status">required</span> `boolean`
Returns `true` when the file is being uploaded.
---
**<span className="parameter-name">progress</span>** <span className="optional-status">required</span> `null` | `number`
Returns the progress of the upload, from 0 to 100. Returns null if the upload has not started yet.
---

View File

@@ -0,0 +1,44 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: useFileUploadItem()
sidebar_label: useFileUploadItem()
slug: /reference/nextjs/use-file-upload-item
description: Use the hook `useFileUploadItem` to control the file upload of a file in a multiple file upload.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/react/src/useFileUpload.ts#L61
---
# `useFileUploadItem()`
Use the hook `useFileUploadItem` to control the file upload of a file in a multiple file upload.
It has the same signature as `useFileUpload`.
```tsx
const Item = ({ itemRef }) => {
const { name, progress } = useFileUploadItem(itemRef)
return (
<li>
{name} {progress}
</li>
)
}
const List = () => {
const { list } = useMultipleFilesUpload()
return (
<ul>
{list.map((itemRef) => (
<Item key={item.id} itemRef={item} />
))}
</ul>
)
}
```
## Parameters
---
**<span className="parameter-name">ref</span>** <span className="optional-status">required</span> `ActorRefWithDeprecatedState<FileUploadContext, { type: "ADD", file: File, id: string, bucketId: string, name: string } | { type: "UPLOAD", url: string, file: File, id: string, bucketId: string, name: string, accessToken: string, adminSecret: string } | { type: "UPLOAD_PROGRESS", progress: number, loaded: number, additions: number } | { type: "UPLOAD_DONE", id: string, bucketId: string } | { type: "UPLOAD_ERROR", error: ErrorPayload } | { type: "CANCEL" } | { type: "DESTROY" }, { value: any, context: FileUploadContext }, ResolveTypegenMeta<Typegen0, { type: "ADD", file: File, id: string, bucketId: string, name: string } | { type: "UPLOAD", url: string, file: File, id: string, bucketId: string, name: string, accessToken: string, adminSecret: string } | { type: "UPLOAD_PROGRESS", progress: number, loaded: number, additions: number } | { type: "UPLOAD_DONE", id: string, bucketId: string } | { type: "UPLOAD_ERROR", error: ErrorPayload } | { type: "CANCEL" } | { type: "DESTROY" }, BaseActionObject, ServiceMap>>` | `Interpreter<FileUploadContext, any, { type: "ADD", file: File, id: string, bucketId: string, name: string } | { type: "UPLOAD", url: string, file: File, id: string, bucketId: string, name: string, accessToken: string, adminSecret: string } | { type: "UPLOAD_PROGRESS", progress: number, loaded: number, additions: number } | { type: "UPLOAD_DONE", id: string, bucketId: string } | { type: "UPLOAD_ERROR", error: ErrorPayload } | { type: "CANCEL" } | { type: "DESTROY" }, { value: any, context: FileUploadContext }, ResolveTypegenMeta<Typegen0, { type: "ADD", file: File, id: string, bucketId: string, name: string } | { type: "UPLOAD", url: string, file: File, id: string, bucketId: string, name: string, accessToken: string, adminSecret: string } | { type: "UPLOAD_PROGRESS", progress: number, loaded: number, additions: number } | { type: "UPLOAD_DONE", id: string, bucketId: string } | { type: "UPLOAD_ERROR", error: ErrorPayload } | { type: "CANCEL" } | { type: "DESTROY" }, BaseActionObject, ServiceMap>>`
---

View File

@@ -0,0 +1,33 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: useFileUpload()
sidebar_label: useFileUpload()
slug: /reference/nextjs/use-file-upload
description: Use the hook `useFileUpload` to upload a file.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/react/src/useFileUpload.ts#L142
---
# `useFileUpload()`
Use the hook `useFileUpload` to upload a file.
```tsx
const {
add,
upload,
cancel,
isUploaded,
isUploading,
isError,
progress,
id,
bucketId,
name
} = useFileUpload()
const handleFormSubmit = async (e) => {
e.preventDefault()
await upload({ file })
}
```

View File

@@ -0,0 +1,12 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: useMultipleFilesUpload()
sidebar_label: useMultipleFilesUpload()
slug: /reference/nextjs/use-multiple-files-upload
description: Use the hook `useFileUpload` to upload multiple files.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/react/src/useMultipleFilesUpload.ts#L55
---
# `useMultipleFilesUpload()`
Use the hook `useFileUpload` to upload multiple files.

View File

@@ -3,13 +3,17 @@
title: useNhostBackendUrl()
sidebar_label: useNhostBackendUrl()
slug: /reference/nextjs/use-nhost-backend-url
description: Use the hook `useNhostBackendUrl` to get the Nhost backend URL.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/react/src/useNhostBackendUrl.ts#L15
sidebar_class_name: deprecated
description: No description provided.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/react/src/useNhostBackendUrl.ts#L16
---
# `useNhostBackendUrl()`
:::caution Deprecated
Nhost services can now be split to subdomains to improve performance with CDN. Use `nhost.auth.url` or `nhost.storage.url` instead.
Use the hook `useNhostBackendUrl` to get the Nhost backend URL.
:::
```tsx
const nhostBackendUrl = useNhostBackendUrl()

View File

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

View File

@@ -0,0 +1,10 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: FileItemRef
sidebar_label: FileItemRef
description: No description provided.
displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-storage-js/src/machines/multiple-files-upload.ts#L7
---
# `FileItemRef`

View File

@@ -0,0 +1,80 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: FileUploadHookResult
sidebar_label: FileUploadHookResult
description: No description provided.
displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/react/src/useFileUpload.ts#L16
---
# `FileUploadHookResult`
## Parameters
---
**<span className="parameter-name">isError</span>** <span className="optional-status">required</span> `boolean`
**`@returns`**
`true` if an error occurred
**`@depreacted`**
use `!isSuccess` or `!!error` instead
---
**<span className="parameter-name">error</span>** <span className="optional-status">required</span> `null` | `ErrorPayload`
Provides details about the error
---
**<span className="parameter-name">isUploading</span>** <span className="optional-status">required</span> `boolean`
Returns `true` when the file is being uploaded.
---
**<span className="parameter-name">progress</span>** <span className="optional-status">required</span> `null` | `number`
Returns the progress of the upload, from 0 to 100. Returns null if the upload has not started yet.
---
**<span className="parameter-name">isUploaded</span>** <span className="optional-status">required</span> `boolean`
Returns `true` when the file has been successfully uploaded.
---
**<span className="parameter-name">id</span>** <span className="optional-status">optional</span> `string`
Returns the id of the file.
---
**<span className="parameter-name">bucketId</span>** <span className="optional-status">optional</span> `string`
Returns the bucket id.
---
**<span className="parameter-name">name</span>** <span className="optional-status">optional</span> `string`
Returns the name of the file.
---
**<span className="parameter-name">add</span>** <span className="optional-status">required</span> `(params: StorageUploadParams) => void`
---
**<span className="parameter-name">upload</span>** <span className="optional-status">required</span> `(params: Partial<StorageUploadParams>) => Promise<UploadFileHandlerResult>`
---
**<span className="parameter-name">cancel</span>** <span className="optional-status">required</span> `() => void`
---

View File

@@ -0,0 +1,66 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: MultipleFilesHookResult
sidebar_label: MultipleFilesHookResult
description: No description provided.
displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/react/src/useMultipleFilesUpload.ts#L15
---
# `MultipleFilesHookResult`
## Parameters
---
**<span className="parameter-name">isUploading</span>** <span className="optional-status">required</span> `boolean`
Returns `true` when the files are being uploaded.
---
**<span className="parameter-name">progress</span>** <span className="optional-status">required</span> `null` | `number`
Returns the overall progress of the upload, from 0 to 100. Returns null if the upload has not started yet.
---
**<span className="parameter-name">files</span>** <span className="optional-status">required</span> `Array<ActorRefWithDeprecatedState<FileUploadContext, { type: "ADD", file: File, id: string, bucketId: string, name: string } | { type: "UPLOAD", url: string, file: File, id: string, bucketId: string, name: string, accessToken: string, adminSecret: string } | { type: "UPLOAD_PROGRESS", progress: number, loaded: number, additions: number } | { type: "UPLOAD_DONE", id: string, bucketId: string } | { type: "UPLOAD_ERROR", error: ErrorPayload } | { type: "CANCEL" } | { type: "DESTROY" }, { value: any, context: FileUploadContext }, ResolveTypegenMeta<Typegen0, { type: "ADD", file: File, id: string, bucketId: string, name: string } | { type: "UPLOAD", url: string, file: File, id: string, bucketId: string, name: string, accessToken: string, adminSecret: string } | { type: "UPLOAD_PROGRESS", progress: number, loaded: number, additions: number } | { type: "UPLOAD_DONE", id: string, bucketId: string } | { type: "UPLOAD_ERROR", error: ErrorPayload } | { type: "CANCEL" } | { type: "DESTROY" }, BaseActionObject, ServiceMap>>>`
The list of file uploads. The properties can be accessed through `item.getSnapshot()` of with the `useFileUploadItem` hook.
---
**<span className="parameter-name">isError</span>** <span className="optional-status">required</span> `boolean`
Returns `true` when all upload request are processed, but at least one of them has failed.
---
**<span className="parameter-name">errors</span>** <span className="optional-status">required</span> `Array<ActorRefWithDeprecatedState<FileUploadContext, { type: "ADD", file: File, id: string, bucketId: string, name: string } | { type: "UPLOAD", url: string, file: File, id: string, bucketId: string, name: string, accessToken: string, adminSecret: string } | { type: "UPLOAD_PROGRESS", progress: number, loaded: number, additions: number } | { type: "UPLOAD_DONE", id: string, bucketId: string } | { type: "UPLOAD_ERROR", error: ErrorPayload } | { type: "CANCEL" } | { type: "DESTROY" }, { value: any, context: FileUploadContext }, ResolveTypegenMeta<Typegen0, { type: "ADD", file: File, id: string, bucketId: string, name: string } | { type: "UPLOAD", url: string, file: File, id: string, bucketId: string, name: string, accessToken: string, adminSecret: string } | { type: "UPLOAD_PROGRESS", progress: number, loaded: number, additions: number } | { type: "UPLOAD_DONE", id: string, bucketId: string } | { type: "UPLOAD_ERROR", error: ErrorPayload } | { type: "CANCEL" } | { type: "DESTROY" }, BaseActionObject, ServiceMap>>>`
Returns the list of file uploads that have failed
---
**<span className="parameter-name">isUploaded</span>** <span className="optional-status">required</span> `boolean`
Returns `true` when all the files have been successfully uploaded.
---
**<span className="parameter-name">add</span>** <span className="optional-status">required</span> `(params: Required<Pick<UploadMultipleFilesActionParams, "files">> & UploadMultipleFilesActionParams) => void`
---
**<span className="parameter-name">upload</span>** <span className="optional-status">required</span> `(params: UploadMultipleFilesActionParams) => Promise<MultipleFilesHandlerResult>`
---
**<span className="parameter-name">cancel</span>** <span className="optional-status">required</span> `() => void`
---
**<span className="parameter-name">clear</span>** <span className="optional-status">required</span> `() => void`
---

View File

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

View File

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

View File

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

View File

@@ -0,0 +1,44 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: useFileUploadItem()
sidebar_label: useFileUploadItem()
slug: /reference/react/use-file-upload-item
description: Use the hook `useFileUploadItem` to control the file upload of a file in a multiple file upload.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/react/src/useFileUpload.ts#L61
---
# `useFileUploadItem()`
Use the hook `useFileUploadItem` to control the file upload of a file in a multiple file upload.
It has the same signature as `useFileUpload`.
```tsx
const Item = ({ itemRef }) => {
const { name, progress } = useFileUploadItem(itemRef)
return (
<li>
{name} {progress}
</li>
)
}
const List = () => {
const { list } = useMultipleFilesUpload()
return (
<ul>
{list.map((itemRef) => (
<Item key={item.id} itemRef={item} />
))}
</ul>
)
}
```
## Parameters
---
**<span className="parameter-name">ref</span>** <span className="optional-status">required</span> `ActorRefWithDeprecatedState<FileUploadContext, { type: "ADD", file: File, id: string, bucketId: string, name: string } | { type: "UPLOAD", url: string, file: File, id: string, bucketId: string, name: string, accessToken: string, adminSecret: string } | { type: "UPLOAD_PROGRESS", progress: number, loaded: number, additions: number } | { type: "UPLOAD_DONE", id: string, bucketId: string } | { type: "UPLOAD_ERROR", error: ErrorPayload } | { type: "CANCEL" } | { type: "DESTROY" }, { value: any, context: FileUploadContext }, ResolveTypegenMeta<Typegen0, { type: "ADD", file: File, id: string, bucketId: string, name: string } | { type: "UPLOAD", url: string, file: File, id: string, bucketId: string, name: string, accessToken: string, adminSecret: string } | { type: "UPLOAD_PROGRESS", progress: number, loaded: number, additions: number } | { type: "UPLOAD_DONE", id: string, bucketId: string } | { type: "UPLOAD_ERROR", error: ErrorPayload } | { type: "CANCEL" } | { type: "DESTROY" }, BaseActionObject, ServiceMap>>` | `Interpreter<FileUploadContext, any, { type: "ADD", file: File, id: string, bucketId: string, name: string } | { type: "UPLOAD", url: string, file: File, id: string, bucketId: string, name: string, accessToken: string, adminSecret: string } | { type: "UPLOAD_PROGRESS", progress: number, loaded: number, additions: number } | { type: "UPLOAD_DONE", id: string, bucketId: string } | { type: "UPLOAD_ERROR", error: ErrorPayload } | { type: "CANCEL" } | { type: "DESTROY" }, { value: any, context: FileUploadContext }, ResolveTypegenMeta<Typegen0, { type: "ADD", file: File, id: string, bucketId: string, name: string } | { type: "UPLOAD", url: string, file: File, id: string, bucketId: string, name: string, accessToken: string, adminSecret: string } | { type: "UPLOAD_PROGRESS", progress: number, loaded: number, additions: number } | { type: "UPLOAD_DONE", id: string, bucketId: string } | { type: "UPLOAD_ERROR", error: ErrorPayload } | { type: "CANCEL" } | { type: "DESTROY" }, BaseActionObject, ServiceMap>>`
---

View File

@@ -0,0 +1,33 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: useFileUpload()
sidebar_label: useFileUpload()
slug: /reference/react/use-file-upload
description: Use the hook `useFileUpload` to upload a file.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/react/src/useFileUpload.ts#L142
---
# `useFileUpload()`
Use the hook `useFileUpload` to upload a file.
```tsx
const {
add,
upload,
cancel,
isUploaded,
isUploading,
isError,
progress,
id,
bucketId,
name
} = useFileUpload()
const handleFormSubmit = async (e) => {
e.preventDefault()
await upload({ file })
}
```

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