├── .gitbook.yaml ├── .gitbook └── assets │ ├── 01_frontend-api-key.png │ ├── 01_supabase-template.png │ ├── 02_fauna-security.png │ ├── 02_jwt-claims.png │ ├── 03_jwt-secret.png │ ├── 03_provider-form.png │ ├── 04_jwt-template.png │ ├── 04_signing-key (1).png │ ├── 04_signing-key.png │ ├── 05_clerk-frontend-api.png │ ├── 05_token-claims.png │ ├── 06_starter-screen.png │ ├── 06_supabase-keys.png │ ├── 07_app-screen (1).png │ ├── 07_app-screen.png │ ├── COMB-server-api-oas3.yml │ ├── Screen Shot 2021-07-28 at 11.51.32 PM.png │ ├── Screen Shot 2021-08-02 at 10.41.08 PM.png │ ├── Screen Shot 2021-10-01 at 1.19.38 PM.png │ ├── Screen Shot 2022-01-21 at 2.57.32 PM.png │ ├── Screenshot 2021-07-27 at 11.37.25 AM.png │ ├── Screenshot 2021-07-27 at 9.34.33 AM.png │ ├── Screenshot 2021-10-01 at 12.49.54 PM.png │ ├── Screenshot 2021-10-01 at 12.51.41 PM.png │ ├── Screenshot 2021-10-01 at 12.54.06 PM.png │ ├── Screenshot.jpg │ ├── add new application page.png │ ├── add-endpoint-svix.png │ ├── alignment.png │ ├── api_secret.gif │ ├── backend.png │ ├── be-api-key.png │ ├── bg_menu.png │ ├── bitbucket_oauth_consumer_1.png │ ├── bitbucket_oauth_consumers (1).png │ ├── bitbucket_oauth_consumers.png │ ├── bitbucket_workspaces.png │ ├── blocks.png │ ├── border.png │ ├── branded_classes.png │ ├── bubble.io_page_type=custom&name=Header&id=peter-clerk-test-app&test_plugin=1626444962690x347764556487458800_current&tab=tabs-1.png │ ├── bubble.io_page_type=custom&name=Header&id=peter-clerk-test-app&test_plugin=1626444962690x347764556487458800_current&tab=tabs-2 (1).png │ ├── bubble.io_page_type=custom&name=Header&id=peter-clerk-test-app&test_plugin=1626444962690x347764556487458800_current&tab=tabs-2 (2).png │ ├── bubble.io_page_type=custom&name=Header&id=peter-clerk-test-app&test_plugin=1626444962690x347764556487458800_current&tab=tabs-2.png │ ├── cl-branded-button.png │ ├── clerk-html-starter-1yvjin.stackblitz.io_ (1).png │ ├── clerk-html-starter-1yvjin.stackblitz.io_ (2).png │ ├── clerk-html-starter-1yvjin.stackblitz.io_ (3).png │ ├── clerk-html-starter-1yvjin.stackblitz.io_ (4) (1).png │ ├── clerk-html-starter-1yvjin.stackblitz.io_ (4).png │ ├── clerk-html-starter-1yvjin.stackblitz.io_ (5).png │ ├── copy_prompt.png │ ├── dashboard-v1-contact-info-phone.png │ ├── dashboard.clerk.dev_instances_ins_1vf0xwsssrY15LD8FLZw4GQYZEJ_url-settings.png │ ├── dashboard.prod.lclclerk.com_applications_app_1qnUZ1eK4LSvdig9wr7pZ81hnVP_instances (1).png │ ├── dashboard_redirect_uri (1).png │ ├── dashboard_redirect_uri.png │ ├── discord-create-app.png │ ├── discord-credentials.png │ ├── email_editor.png │ ├── email_preview.png │ ├── email_template_editor (1).png │ ├── email_template_editor.png │ ├── email_template_list.png │ ├── email_template_preview.png │ ├── email_toolbar_textarea.png │ ├── enable-svix.png │ ├── enter-endpoint-svix.png │ ├── frontend.png │ ├── get-started-next-fapi.png │ ├── gitlab-create-app.png │ ├── gitlab-credentials.png │ ├── hasura-env-vars.png │ ├── hasura-template.png │ ├── hasura-token-claims.png │ ├── home - backend api key highlighted.png │ ├── home - frontend api key highlighted.png │ ├── html_view (1).png │ ├── html_view.png │ ├── image (1).png │ ├── image (10).png │ ├── image (11).png │ ├── image (12).png │ ├── image (13).png │ ├── image (14).png │ ├── image (2) (1).png │ ├── image (2).png │ ├── image (3).png │ ├── image (4).png │ ├── image (5).png │ ├── image (6) (1).png │ ├── image (6).png │ ├── image (7) (1).png │ ├── image (7).png │ ├── image (8) (1) (1) (1).png │ ├── image (8) (1) (1).png │ ├── image (8) (1).png │ ├── image (8).png │ ├── image (9).png │ ├── image.png │ ├── imgonline-com-ua-twotoone-r7j7RPyMYnjWVvLE.jpg │ ├── imgonline-com-ua-twotoone-tTWFL7dFHhWMqPDh.jpg │ ├── instance-configuration.png │ ├── link.png │ ├── measurement_id.gif │ ├── mobile_view (1).png │ ├── mobile_view.png │ ├── move-delete-clone.png │ ├── ms_add_application.png │ ├── ms_apps.png │ ├── ms_certs_secrets.png │ ├── ms_creds.png │ ├── ms_id_token.png │ ├── oauth-notion-create-app.png │ ├── oauth-notion-credentials.png │ ├── oauth-notion-public-integration.png │ ├── oauth-twitter-app-screen.png │ ├── oauth_dropbox_create_app.png │ ├── oauth_dropbox_credentials.png │ ├── oauth_linkedin_create_app.png │ ├── oauth_linkedin_credentials.png │ ├── oauth_linkedin_enable_sign_in.png │ ├── oauth_twitter-auth-screen.png │ ├── pbkdf2.go │ ├── preview_icon.png │ ├── revert_email.png │ ├── revert_prompt.png │ ├── screely-1627110327003.png │ ├── screely-1627110354630.png │ ├── screely-1627111581779.png │ ├── screely-1627278145637.png │ ├── screely-1627278226541.png │ ├── screely-1627298418851.png │ ├── screely-1627298607140.png │ ├── screely-1627299008665.png │ ├── screely-1627301245718.png │ ├── screely-1627301486853.png │ ├── screely-1627310188274.png │ ├── screely-1627542624914.png │ ├── screely-1627992033080.png │ ├── screely-1628012661920.png │ ├── screely-1628371519080.png │ ├── screely-1628371792291.png │ ├── screely-1628372330828.png │ ├── screely-1628400578955.png │ ├── screely-1628401421226.png │ ├── screely-1628401739107.png │ ├── screely-1628402032599.png │ ├── screely-1628426717069.png │ ├── screely-1628427343412.png │ ├── screely-1628428985188.png │ ├── screely-1628431072612.png │ ├── screely-1628433157057.png │ ├── screely-1628582135918.png │ ├── screely-1628582214290.png │ ├── screely-1628678108916.png │ ├── screely-1629059863725.png │ ├── screely-1629454849538.png │ ├── screely-1635937359164.png │ ├── screely-1635937960025.png │ ├── screely-1635938557949.png │ ├── screely-1635938661317.png │ ├── screely-1639471587036.png │ ├── screely-1639471746983.png │ ├── screely-1639472270537.png │ ├── screely-1639474987551.png │ ├── screely-1639475393023.png │ ├── screely-1639475673738.png │ ├── screely-1639502896635.png │ ├── screely-1639504293519.png │ ├── screely-1639505381830.png │ ├── screely-1639505474295.png │ ├── screely-1639505701741.png │ ├── screely-1639505933346.png │ ├── screely-1639506200009.png │ ├── screely-1639506400176.png │ ├── screely-1639506705225.png │ ├── screely-1639506808306.png │ ├── screely-1639506924024.png │ ├── screely-1639507070957.png │ ├── screely-1639507169948.png │ ├── screely-1639507396704.png │ ├── screely-1639507436297.png │ ├── screely-1639507631524.png │ ├── screely-1639507638521.png │ ├── screely-1639507886785.png │ ├── screely-1639508092338.png │ ├── screely-1639508509124.png │ ├── screely-1639508603276.png │ ├── screely-1639508827688.png │ ├── screely-1639508930568 (1).png │ ├── screely-1639508930568.png │ ├── screely-1639508959537.png │ ├── screely-1639509148300.png │ ├── screely-1639740561552.png │ ├── screely-1640260381804.png │ ├── screely-1643278638354.png │ ├── screely-1643297073863.png │ ├── screely-1643299290887.png │ ├── screely-1647269950072 (1).png │ ├── screely-1647269950072.png │ ├── screely-1647345516165.png │ ├── screely-1647345978596.png │ ├── screely-1647346157966.png │ ├── screely-1647346291686.png │ ├── screely-1647346884993.png │ ├── screely-1647347180148.png │ ├── screely-1647348882514 (1).png │ ├── screely-1647348882514.png │ ├── screely-1647349133522.png │ ├── screely-1647349298346.png │ ├── screely-1647349602845.png │ ├── screely-1647349973601.png │ ├── screely-1647420837282.png │ ├── screely-1647421408838.png │ ├── screely-1647421561951 (1).png │ ├── screely-1647421561951.png │ ├── screely-1647422444524.png │ ├── screely-1647423220677.png │ ├── screely-1647424115224.png │ ├── screely-1647424371277.png │ ├── screely-1647605116883.png │ ├── screely-1647605231539.png │ ├── screely-1647605289476.png │ ├── screely-1647605451432.png │ ├── screely-1647605782378.png │ ├── screely-1647606249351.png │ ├── screely-1649325142630 (1).png │ ├── screely-1649325142630.png │ ├── screely-1649325378902.png │ ├── screenshot_20211020_105434.png │ ├── screenshot_20211020_111528.png │ ├── screenshot_20220314_165742.png │ ├── screenshot_20220315_140544 (1).png │ ├── screenshot_20220315_140544.png │ ├── screenshot_20220316_115206.png │ ├── select-events-svix.png │ ├── session_inactivity_timeout.png │ ├── session_maximum_lifetime.png │ ├── settings.png │ ├── shortcuts.png │ ├── sign-in (1).png │ ├── sign-in.png │ ├── sign-up.png │ ├── sms_preview.png │ ├── sms_template_editor (1).png │ ├── sms_template_editor.png │ ├── sms_template_list.png │ ├── sms_template_preview.png │ ├── sms_variable_widget.png │ ├── social-signin-1.png │ ├── social-signin-enable-providers.png │ ├── social-signin-hosted-pages-links.png │ ├── social-signin-manage-credentials.png │ ├── social-signin-mounted-prebuild-signup.png │ ├── social-signin-social-login-buttons.png │ ├── social_all_providers.png │ ├── social_configuring_google.png │ ├── sync_data_clerk.png │ ├── sync_data_synchronous_clerk.png │ ├── text_color.png │ ├── twitch-create-oauth-app-1.png │ ├── twitch-create-oauth-app-2.png │ ├── twitch-credentials.png │ ├── twitter_auth_settings.png │ ├── twitter_auth_settings_in.png │ ├── user-button.png │ ├── user-profile.png │ ├── variable.png │ └── variable_widget.png ├── README.md ├── SUMMARY.md ├── get-started ├── create-react-app.md ├── get-started-with-gatsby.md ├── get-started-with-web3.md ├── nextjs-api.md ├── nextjs.md ├── redwoodjs.md └── remix.md ├── integrations ├── bubble.io-beta.md ├── fauna.md ├── firebase.md ├── google-analytics.md ├── hasura.md └── supabase.md ├── main-concepts ├── auth-v2.md ├── session-lifetime.md ├── sign-in-flow.md ├── sign-up-flow.md └── user-object.md ├── popular-guides ├── build-your-own-ui.md ├── email-and-password.md ├── invitations.md ├── jwt-templates.md ├── magic-links.md ├── making-authenticated-requests-to-the-backend.md ├── multi-factor-authentication.md ├── organizations.md ├── passwordless-authentication.md ├── popular-guides-multi-session-applications.md ├── popular-guides-sign-out.md ├── production-setup.md ├── setup-your-application.md ├── social-login-oauth.md ├── ssr-beta.md ├── sync-data-to-your-backend.md └── validating-session-tokens.md └── reference ├── email-and-sms-templates.md └── frontend-api-reference ├── README.md ├── introduction.md ├── organization-requests ├── README.md ├── organization-invitations-requests.md ├── organization-membership-requests.md └── organization-requests.md ├── user-api ├── README.md ├── client.md ├── introduction.md ├── sessions.md ├── sign-ins.md └── sign-ups.md ├── users ├── README.md ├── email-addresses.md ├── introduction.md ├── organizations-1.md ├── organizations-2.md ├── organizations.md ├── phone-numbers.md ├── profile-image.md ├── sessions.md ├── tokens.md └── user.md └── well-known-requests.md /.gitbook.yaml: -------------------------------------------------------------------------------- 1 | redirects: 2 | popular-guides/ssr-beta: /get-started/nextjs.md 3 | get-started/nextjs-api: /get-started/nextjs.md 4 | -------------------------------------------------------------------------------- /.gitbook/assets/01_frontend-api-key.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/01_frontend-api-key.png -------------------------------------------------------------------------------- /.gitbook/assets/01_supabase-template.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/01_supabase-template.png -------------------------------------------------------------------------------- /.gitbook/assets/02_fauna-security.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/02_fauna-security.png -------------------------------------------------------------------------------- /.gitbook/assets/02_jwt-claims.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/02_jwt-claims.png -------------------------------------------------------------------------------- /.gitbook/assets/03_jwt-secret.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/03_jwt-secret.png -------------------------------------------------------------------------------- /.gitbook/assets/03_provider-form.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/03_provider-form.png -------------------------------------------------------------------------------- /.gitbook/assets/04_jwt-template.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/04_jwt-template.png -------------------------------------------------------------------------------- /.gitbook/assets/04_signing-key (1).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/04_signing-key (1).png -------------------------------------------------------------------------------- /.gitbook/assets/04_signing-key.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/04_signing-key.png -------------------------------------------------------------------------------- /.gitbook/assets/05_clerk-frontend-api.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/05_clerk-frontend-api.png -------------------------------------------------------------------------------- /.gitbook/assets/05_token-claims.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/05_token-claims.png -------------------------------------------------------------------------------- /.gitbook/assets/06_starter-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/06_starter-screen.png -------------------------------------------------------------------------------- /.gitbook/assets/06_supabase-keys.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/06_supabase-keys.png -------------------------------------------------------------------------------- /.gitbook/assets/07_app-screen (1).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/07_app-screen (1).png -------------------------------------------------------------------------------- /.gitbook/assets/07_app-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/07_app-screen.png -------------------------------------------------------------------------------- /.gitbook/assets/Screen Shot 2021-07-28 at 11.51.32 PM.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/Screen Shot 2021-07-28 at 11.51.32 PM.png -------------------------------------------------------------------------------- /.gitbook/assets/Screen Shot 2021-08-02 at 10.41.08 PM.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/Screen Shot 2021-08-02 at 10.41.08 PM.png -------------------------------------------------------------------------------- /.gitbook/assets/Screen Shot 2021-10-01 at 1.19.38 PM.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/Screen Shot 2021-10-01 at 1.19.38 PM.png -------------------------------------------------------------------------------- /.gitbook/assets/Screen Shot 2022-01-21 at 2.57.32 PM.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/Screen Shot 2022-01-21 at 2.57.32 PM.png -------------------------------------------------------------------------------- /.gitbook/assets/Screenshot 2021-07-27 at 11.37.25 AM.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/Screenshot 2021-07-27 at 11.37.25 AM.png -------------------------------------------------------------------------------- /.gitbook/assets/Screenshot 2021-07-27 at 9.34.33 AM.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/Screenshot 2021-07-27 at 9.34.33 AM.png -------------------------------------------------------------------------------- /.gitbook/assets/Screenshot 2021-10-01 at 12.49.54 PM.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/Screenshot 2021-10-01 at 12.49.54 PM.png -------------------------------------------------------------------------------- /.gitbook/assets/Screenshot 2021-10-01 at 12.51.41 PM.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/Screenshot 2021-10-01 at 12.51.41 PM.png -------------------------------------------------------------------------------- /.gitbook/assets/Screenshot 2021-10-01 at 12.54.06 PM.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/Screenshot 2021-10-01 at 12.54.06 PM.png -------------------------------------------------------------------------------- /.gitbook/assets/Screenshot.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/Screenshot.jpg -------------------------------------------------------------------------------- /.gitbook/assets/add new application page.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/add new application page.png -------------------------------------------------------------------------------- /.gitbook/assets/add-endpoint-svix.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/add-endpoint-svix.png -------------------------------------------------------------------------------- /.gitbook/assets/alignment.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/alignment.png -------------------------------------------------------------------------------- /.gitbook/assets/api_secret.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/api_secret.gif -------------------------------------------------------------------------------- /.gitbook/assets/backend.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/backend.png -------------------------------------------------------------------------------- /.gitbook/assets/be-api-key.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/be-api-key.png -------------------------------------------------------------------------------- /.gitbook/assets/bg_menu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/bg_menu.png -------------------------------------------------------------------------------- /.gitbook/assets/bitbucket_oauth_consumer_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/bitbucket_oauth_consumer_1.png -------------------------------------------------------------------------------- /.gitbook/assets/bitbucket_oauth_consumers (1).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/bitbucket_oauth_consumers (1).png -------------------------------------------------------------------------------- /.gitbook/assets/bitbucket_oauth_consumers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/bitbucket_oauth_consumers.png -------------------------------------------------------------------------------- /.gitbook/assets/bitbucket_workspaces.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/bitbucket_workspaces.png -------------------------------------------------------------------------------- /.gitbook/assets/blocks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/blocks.png -------------------------------------------------------------------------------- /.gitbook/assets/border.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/border.png -------------------------------------------------------------------------------- /.gitbook/assets/branded_classes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/branded_classes.png -------------------------------------------------------------------------------- /.gitbook/assets/bubble.io_page_type=custom&name=Header&id=peter-clerk-test-app&test_plugin=1626444962690x347764556487458800_current&tab=tabs-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/bubble.io_page_type=custom&name=Header&id=peter-clerk-test-app&test_plugin=1626444962690x347764556487458800_current&tab=tabs-1.png -------------------------------------------------------------------------------- /.gitbook/assets/bubble.io_page_type=custom&name=Header&id=peter-clerk-test-app&test_plugin=1626444962690x347764556487458800_current&tab=tabs-2 (1).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/bubble.io_page_type=custom&name=Header&id=peter-clerk-test-app&test_plugin=1626444962690x347764556487458800_current&tab=tabs-2 (1).png -------------------------------------------------------------------------------- /.gitbook/assets/bubble.io_page_type=custom&name=Header&id=peter-clerk-test-app&test_plugin=1626444962690x347764556487458800_current&tab=tabs-2 (2).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/bubble.io_page_type=custom&name=Header&id=peter-clerk-test-app&test_plugin=1626444962690x347764556487458800_current&tab=tabs-2 (2).png -------------------------------------------------------------------------------- /.gitbook/assets/bubble.io_page_type=custom&name=Header&id=peter-clerk-test-app&test_plugin=1626444962690x347764556487458800_current&tab=tabs-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/bubble.io_page_type=custom&name=Header&id=peter-clerk-test-app&test_plugin=1626444962690x347764556487458800_current&tab=tabs-2.png -------------------------------------------------------------------------------- /.gitbook/assets/cl-branded-button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/cl-branded-button.png -------------------------------------------------------------------------------- /.gitbook/assets/clerk-html-starter-1yvjin.stackblitz.io_ (1).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/clerk-html-starter-1yvjin.stackblitz.io_ (1).png -------------------------------------------------------------------------------- /.gitbook/assets/clerk-html-starter-1yvjin.stackblitz.io_ (2).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/clerk-html-starter-1yvjin.stackblitz.io_ (2).png -------------------------------------------------------------------------------- /.gitbook/assets/clerk-html-starter-1yvjin.stackblitz.io_ (3).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/clerk-html-starter-1yvjin.stackblitz.io_ (3).png -------------------------------------------------------------------------------- /.gitbook/assets/clerk-html-starter-1yvjin.stackblitz.io_ (4) (1).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/clerk-html-starter-1yvjin.stackblitz.io_ (4) (1).png -------------------------------------------------------------------------------- /.gitbook/assets/clerk-html-starter-1yvjin.stackblitz.io_ (4).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/clerk-html-starter-1yvjin.stackblitz.io_ (4).png -------------------------------------------------------------------------------- /.gitbook/assets/clerk-html-starter-1yvjin.stackblitz.io_ (5).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/clerk-html-starter-1yvjin.stackblitz.io_ (5).png -------------------------------------------------------------------------------- /.gitbook/assets/copy_prompt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/copy_prompt.png -------------------------------------------------------------------------------- /.gitbook/assets/dashboard-v1-contact-info-phone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/dashboard-v1-contact-info-phone.png -------------------------------------------------------------------------------- /.gitbook/assets/dashboard.clerk.dev_instances_ins_1vf0xwsssrY15LD8FLZw4GQYZEJ_url-settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/dashboard.clerk.dev_instances_ins_1vf0xwsssrY15LD8FLZw4GQYZEJ_url-settings.png -------------------------------------------------------------------------------- /.gitbook/assets/dashboard.prod.lclclerk.com_applications_app_1qnUZ1eK4LSvdig9wr7pZ81hnVP_instances (1).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/dashboard.prod.lclclerk.com_applications_app_1qnUZ1eK4LSvdig9wr7pZ81hnVP_instances (1).png -------------------------------------------------------------------------------- /.gitbook/assets/dashboard_redirect_uri (1).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/dashboard_redirect_uri (1).png -------------------------------------------------------------------------------- /.gitbook/assets/dashboard_redirect_uri.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/dashboard_redirect_uri.png -------------------------------------------------------------------------------- /.gitbook/assets/discord-create-app.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/discord-create-app.png -------------------------------------------------------------------------------- /.gitbook/assets/discord-credentials.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/discord-credentials.png -------------------------------------------------------------------------------- /.gitbook/assets/email_editor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/email_editor.png -------------------------------------------------------------------------------- /.gitbook/assets/email_preview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/email_preview.png -------------------------------------------------------------------------------- /.gitbook/assets/email_template_editor (1).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/email_template_editor (1).png -------------------------------------------------------------------------------- /.gitbook/assets/email_template_editor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/email_template_editor.png -------------------------------------------------------------------------------- /.gitbook/assets/email_template_list.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/email_template_list.png -------------------------------------------------------------------------------- /.gitbook/assets/email_template_preview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/email_template_preview.png -------------------------------------------------------------------------------- /.gitbook/assets/email_toolbar_textarea.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/email_toolbar_textarea.png -------------------------------------------------------------------------------- /.gitbook/assets/enable-svix.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/enable-svix.png -------------------------------------------------------------------------------- /.gitbook/assets/enter-endpoint-svix.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/enter-endpoint-svix.png -------------------------------------------------------------------------------- /.gitbook/assets/frontend.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/frontend.png -------------------------------------------------------------------------------- /.gitbook/assets/get-started-next-fapi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/get-started-next-fapi.png -------------------------------------------------------------------------------- /.gitbook/assets/gitlab-create-app.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/gitlab-create-app.png -------------------------------------------------------------------------------- /.gitbook/assets/gitlab-credentials.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/gitlab-credentials.png -------------------------------------------------------------------------------- /.gitbook/assets/hasura-env-vars.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/hasura-env-vars.png -------------------------------------------------------------------------------- /.gitbook/assets/hasura-template.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/hasura-template.png -------------------------------------------------------------------------------- /.gitbook/assets/hasura-token-claims.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/hasura-token-claims.png -------------------------------------------------------------------------------- /.gitbook/assets/home - backend api key highlighted.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/home - backend api key highlighted.png -------------------------------------------------------------------------------- /.gitbook/assets/home - frontend api key highlighted.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/home - frontend api key highlighted.png -------------------------------------------------------------------------------- /.gitbook/assets/html_view (1).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/html_view (1).png -------------------------------------------------------------------------------- /.gitbook/assets/html_view.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/html_view.png -------------------------------------------------------------------------------- /.gitbook/assets/image (1).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/image (1).png -------------------------------------------------------------------------------- /.gitbook/assets/image (10).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/image (10).png -------------------------------------------------------------------------------- /.gitbook/assets/image (11).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/image (11).png -------------------------------------------------------------------------------- /.gitbook/assets/image (12).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/image (12).png -------------------------------------------------------------------------------- /.gitbook/assets/image (13).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/image (13).png -------------------------------------------------------------------------------- /.gitbook/assets/image (14).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/image (14).png -------------------------------------------------------------------------------- /.gitbook/assets/image (2) (1).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/image (2) (1).png -------------------------------------------------------------------------------- /.gitbook/assets/image (2).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/image (2).png -------------------------------------------------------------------------------- /.gitbook/assets/image (3).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/image (3).png -------------------------------------------------------------------------------- /.gitbook/assets/image (4).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/image (4).png -------------------------------------------------------------------------------- /.gitbook/assets/image (5).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/image (5).png -------------------------------------------------------------------------------- /.gitbook/assets/image (6) (1).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/image (6) (1).png -------------------------------------------------------------------------------- /.gitbook/assets/image (6).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/image (6).png -------------------------------------------------------------------------------- /.gitbook/assets/image (7) (1).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/image (7) (1).png -------------------------------------------------------------------------------- /.gitbook/assets/image (7).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/image (7).png -------------------------------------------------------------------------------- /.gitbook/assets/image (8) (1) (1) (1).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/image (8) (1) (1) (1).png -------------------------------------------------------------------------------- /.gitbook/assets/image (8) (1) (1).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/image (8) (1) (1).png -------------------------------------------------------------------------------- /.gitbook/assets/image (8) (1).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/image (8) (1).png -------------------------------------------------------------------------------- /.gitbook/assets/image (8).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/image (8).png -------------------------------------------------------------------------------- /.gitbook/assets/image (9).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/image (9).png -------------------------------------------------------------------------------- /.gitbook/assets/image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/image.png -------------------------------------------------------------------------------- /.gitbook/assets/imgonline-com-ua-twotoone-r7j7RPyMYnjWVvLE.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/imgonline-com-ua-twotoone-r7j7RPyMYnjWVvLE.jpg -------------------------------------------------------------------------------- /.gitbook/assets/imgonline-com-ua-twotoone-tTWFL7dFHhWMqPDh.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/imgonline-com-ua-twotoone-tTWFL7dFHhWMqPDh.jpg -------------------------------------------------------------------------------- /.gitbook/assets/instance-configuration.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/instance-configuration.png -------------------------------------------------------------------------------- /.gitbook/assets/link.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/link.png -------------------------------------------------------------------------------- /.gitbook/assets/measurement_id.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/measurement_id.gif -------------------------------------------------------------------------------- /.gitbook/assets/mobile_view (1).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/mobile_view (1).png -------------------------------------------------------------------------------- /.gitbook/assets/mobile_view.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/mobile_view.png -------------------------------------------------------------------------------- /.gitbook/assets/move-delete-clone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/move-delete-clone.png -------------------------------------------------------------------------------- /.gitbook/assets/ms_add_application.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/ms_add_application.png -------------------------------------------------------------------------------- /.gitbook/assets/ms_apps.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/ms_apps.png -------------------------------------------------------------------------------- /.gitbook/assets/ms_certs_secrets.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/ms_certs_secrets.png -------------------------------------------------------------------------------- /.gitbook/assets/ms_creds.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/ms_creds.png -------------------------------------------------------------------------------- /.gitbook/assets/ms_id_token.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/ms_id_token.png -------------------------------------------------------------------------------- /.gitbook/assets/oauth-notion-create-app.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/oauth-notion-create-app.png -------------------------------------------------------------------------------- /.gitbook/assets/oauth-notion-credentials.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/oauth-notion-credentials.png -------------------------------------------------------------------------------- /.gitbook/assets/oauth-notion-public-integration.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/oauth-notion-public-integration.png -------------------------------------------------------------------------------- /.gitbook/assets/oauth-twitter-app-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/oauth-twitter-app-screen.png -------------------------------------------------------------------------------- /.gitbook/assets/oauth_dropbox_create_app.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/oauth_dropbox_create_app.png -------------------------------------------------------------------------------- /.gitbook/assets/oauth_dropbox_credentials.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/oauth_dropbox_credentials.png -------------------------------------------------------------------------------- /.gitbook/assets/oauth_linkedin_create_app.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/oauth_linkedin_create_app.png -------------------------------------------------------------------------------- /.gitbook/assets/oauth_linkedin_credentials.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/oauth_linkedin_credentials.png -------------------------------------------------------------------------------- /.gitbook/assets/oauth_linkedin_enable_sign_in.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/oauth_linkedin_enable_sign_in.png -------------------------------------------------------------------------------- /.gitbook/assets/oauth_twitter-auth-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/oauth_twitter-auth-screen.png -------------------------------------------------------------------------------- /.gitbook/assets/pbkdf2.go: -------------------------------------------------------------------------------- 1 | package hash 2 | 3 | import ( 4 | "bytes" 5 | "crypto/sha256" 6 | "encoding/base64" 7 | "errors" 8 | "fmt" 9 | "strconv" 10 | "strings" 11 | 12 | "golang.org/x/crypto/pbkdf2" 13 | ) 14 | 15 | const ( 16 | keyLen = 32 17 | ) 18 | 19 | type pbkdf2Hasher struct{} 20 | 21 | func (pbkdf2Hasher) Name() string { 22 | return PBKDF2SHA256Django 23 | } 24 | 25 | func (pbkdf2Hasher) Compare(password, encoded string) (bool, error) { 26 | parts := strings.SplitN(encoded, "$", 4) 27 | if len(parts) != 4 { 28 | return false, errors.New("pbkdf2: invalid encoded value, it must consist of 4 segments") 29 | } 30 | 31 | iterations, err := strconv.Atoi(parts[1]) 32 | if err != nil { 33 | return false, fmt.Errorf("pbkdf2: wrong number of iterations %s: %w", parts[1], err) 34 | } 35 | 36 | salt := []byte(parts[2]) 37 | 38 | expectedHash, err := base64.StdEncoding.DecodeString(parts[3]) 39 | if err != nil { 40 | return false, fmt.Errorf("pbkdf2: wrong hash encoding for %s: %w", parts[3], err) 41 | } 42 | 43 | actualHash := pbkdf2.Key([]byte(password), salt, iterations, keyLen, sha256.New) 44 | return bytes.Equal(actualHash, expectedHash), nil 45 | } 46 | 47 | // Validate will check whether the given value is a valid 48 | // hash for PBKDF2 SHA256 Django. 49 | // A valid hash for this variant of PBKDF2 has the following 50 | // form: 51 | // $$$ 52 | // where: 53 | // 1. `algorithm` has value `pbkdf2_sha256` 54 | // 2. `iterations` is the number of iterations the algorithm 55 | // has to run 56 | // 3. `salt` is the salt string that was used to generate the 57 | // hash 58 | // 4. `hash` is the bas64 encoded hash 59 | // 60 | // For more information, check the official Django documentation: 61 | // https://docs.djangoproject.com/en/4.0/topics/auth/passwords/ 62 | func (pbkdf2Hasher) Validate(encoded string) bool { 63 | parts := strings.Split(encoded, "$") 64 | if len(parts) != 4 { 65 | return false 66 | } 67 | 68 | if parts[0] != "pbkdf2_sha256" { 69 | return false 70 | } 71 | 72 | // iterations should be a number 73 | _, err := strconv.Atoi(parts[1]) 74 | return err == nil 75 | } 76 | -------------------------------------------------------------------------------- /.gitbook/assets/preview_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/preview_icon.png -------------------------------------------------------------------------------- /.gitbook/assets/revert_email.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/revert_email.png -------------------------------------------------------------------------------- /.gitbook/assets/revert_prompt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/revert_prompt.png -------------------------------------------------------------------------------- /.gitbook/assets/screely-1627110327003.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/screely-1627110327003.png -------------------------------------------------------------------------------- /.gitbook/assets/screely-1627110354630.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/screely-1627110354630.png -------------------------------------------------------------------------------- /.gitbook/assets/screely-1627111581779.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/screely-1627111581779.png -------------------------------------------------------------------------------- /.gitbook/assets/screely-1627278145637.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/screely-1627278145637.png -------------------------------------------------------------------------------- /.gitbook/assets/screely-1627278226541.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/screely-1627278226541.png -------------------------------------------------------------------------------- /.gitbook/assets/screely-1627298418851.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/screely-1627298418851.png -------------------------------------------------------------------------------- /.gitbook/assets/screely-1627298607140.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/screely-1627298607140.png -------------------------------------------------------------------------------- /.gitbook/assets/screely-1627299008665.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/screely-1627299008665.png -------------------------------------------------------------------------------- /.gitbook/assets/screely-1627301245718.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/screely-1627301245718.png -------------------------------------------------------------------------------- /.gitbook/assets/screely-1627301486853.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/screely-1627301486853.png -------------------------------------------------------------------------------- /.gitbook/assets/screely-1627310188274.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/screely-1627310188274.png -------------------------------------------------------------------------------- /.gitbook/assets/screely-1627542624914.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/screely-1627542624914.png -------------------------------------------------------------------------------- /.gitbook/assets/screely-1627992033080.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/screely-1627992033080.png -------------------------------------------------------------------------------- /.gitbook/assets/screely-1628012661920.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/screely-1628012661920.png -------------------------------------------------------------------------------- /.gitbook/assets/screely-1628371519080.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/screely-1628371519080.png -------------------------------------------------------------------------------- /.gitbook/assets/screely-1628371792291.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/screely-1628371792291.png -------------------------------------------------------------------------------- /.gitbook/assets/screely-1628372330828.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/screely-1628372330828.png -------------------------------------------------------------------------------- /.gitbook/assets/screely-1628400578955.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/screely-1628400578955.png -------------------------------------------------------------------------------- /.gitbook/assets/screely-1628401421226.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/screely-1628401421226.png -------------------------------------------------------------------------------- /.gitbook/assets/screely-1628401739107.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/screely-1628401739107.png -------------------------------------------------------------------------------- /.gitbook/assets/screely-1628402032599.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/screely-1628402032599.png -------------------------------------------------------------------------------- /.gitbook/assets/screely-1628426717069.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/screely-1628426717069.png -------------------------------------------------------------------------------- /.gitbook/assets/screely-1628427343412.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/screely-1628427343412.png -------------------------------------------------------------------------------- /.gitbook/assets/screely-1628428985188.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/screely-1628428985188.png -------------------------------------------------------------------------------- /.gitbook/assets/screely-1628431072612.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/screely-1628431072612.png -------------------------------------------------------------------------------- /.gitbook/assets/screely-1628433157057.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/screely-1628433157057.png -------------------------------------------------------------------------------- /.gitbook/assets/screely-1628582135918.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/screely-1628582135918.png -------------------------------------------------------------------------------- /.gitbook/assets/screely-1628582214290.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/screely-1628582214290.png -------------------------------------------------------------------------------- /.gitbook/assets/screely-1628678108916.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/screely-1628678108916.png -------------------------------------------------------------------------------- /.gitbook/assets/screely-1629059863725.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/screely-1629059863725.png -------------------------------------------------------------------------------- /.gitbook/assets/screely-1629454849538.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/screely-1629454849538.png -------------------------------------------------------------------------------- /.gitbook/assets/screely-1635937359164.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/screely-1635937359164.png -------------------------------------------------------------------------------- /.gitbook/assets/screely-1635937960025.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/screely-1635937960025.png -------------------------------------------------------------------------------- /.gitbook/assets/screely-1635938557949.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/screely-1635938557949.png -------------------------------------------------------------------------------- /.gitbook/assets/screely-1635938661317.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/screely-1635938661317.png -------------------------------------------------------------------------------- /.gitbook/assets/screely-1639471587036.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/screely-1639471587036.png -------------------------------------------------------------------------------- /.gitbook/assets/screely-1639471746983.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/screely-1639471746983.png -------------------------------------------------------------------------------- /.gitbook/assets/screely-1639472270537.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/screely-1639472270537.png -------------------------------------------------------------------------------- /.gitbook/assets/screely-1639474987551.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/screely-1639474987551.png -------------------------------------------------------------------------------- /.gitbook/assets/screely-1639475393023.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/screely-1639475393023.png -------------------------------------------------------------------------------- /.gitbook/assets/screely-1639475673738.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/screely-1639475673738.png -------------------------------------------------------------------------------- /.gitbook/assets/screely-1639502896635.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/screely-1639502896635.png -------------------------------------------------------------------------------- /.gitbook/assets/screely-1639504293519.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/screely-1639504293519.png -------------------------------------------------------------------------------- /.gitbook/assets/screely-1639505381830.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/screely-1639505381830.png -------------------------------------------------------------------------------- /.gitbook/assets/screely-1639505474295.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/screely-1639505474295.png -------------------------------------------------------------------------------- /.gitbook/assets/screely-1639505701741.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/screely-1639505701741.png -------------------------------------------------------------------------------- /.gitbook/assets/screely-1639505933346.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/screely-1639505933346.png -------------------------------------------------------------------------------- /.gitbook/assets/screely-1639506200009.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/screely-1639506200009.png -------------------------------------------------------------------------------- /.gitbook/assets/screely-1639506400176.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/screely-1639506400176.png -------------------------------------------------------------------------------- /.gitbook/assets/screely-1639506705225.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/screely-1639506705225.png -------------------------------------------------------------------------------- /.gitbook/assets/screely-1639506808306.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/screely-1639506808306.png -------------------------------------------------------------------------------- /.gitbook/assets/screely-1639506924024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/screely-1639506924024.png -------------------------------------------------------------------------------- /.gitbook/assets/screely-1639507070957.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/screely-1639507070957.png -------------------------------------------------------------------------------- /.gitbook/assets/screely-1639507169948.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/screely-1639507169948.png -------------------------------------------------------------------------------- /.gitbook/assets/screely-1639507396704.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/screely-1639507396704.png -------------------------------------------------------------------------------- /.gitbook/assets/screely-1639507436297.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/screely-1639507436297.png -------------------------------------------------------------------------------- /.gitbook/assets/screely-1639507631524.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/screely-1639507631524.png -------------------------------------------------------------------------------- /.gitbook/assets/screely-1639507638521.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/screely-1639507638521.png -------------------------------------------------------------------------------- /.gitbook/assets/screely-1639507886785.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/screely-1639507886785.png -------------------------------------------------------------------------------- /.gitbook/assets/screely-1639508092338.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/screely-1639508092338.png -------------------------------------------------------------------------------- /.gitbook/assets/screely-1639508509124.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/screely-1639508509124.png -------------------------------------------------------------------------------- /.gitbook/assets/screely-1639508603276.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/screely-1639508603276.png -------------------------------------------------------------------------------- /.gitbook/assets/screely-1639508827688.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/screely-1639508827688.png -------------------------------------------------------------------------------- /.gitbook/assets/screely-1639508930568 (1).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/screely-1639508930568 (1).png -------------------------------------------------------------------------------- /.gitbook/assets/screely-1639508930568.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/screely-1639508930568.png -------------------------------------------------------------------------------- /.gitbook/assets/screely-1639508959537.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/screely-1639508959537.png -------------------------------------------------------------------------------- /.gitbook/assets/screely-1639509148300.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/screely-1639509148300.png -------------------------------------------------------------------------------- /.gitbook/assets/screely-1639740561552.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/screely-1639740561552.png -------------------------------------------------------------------------------- /.gitbook/assets/screely-1640260381804.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/screely-1640260381804.png -------------------------------------------------------------------------------- /.gitbook/assets/screely-1643278638354.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/screely-1643278638354.png -------------------------------------------------------------------------------- /.gitbook/assets/screely-1643297073863.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/screely-1643297073863.png -------------------------------------------------------------------------------- /.gitbook/assets/screely-1643299290887.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/screely-1643299290887.png -------------------------------------------------------------------------------- /.gitbook/assets/screely-1647269950072 (1).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/screely-1647269950072 (1).png -------------------------------------------------------------------------------- /.gitbook/assets/screely-1647269950072.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/screely-1647269950072.png -------------------------------------------------------------------------------- /.gitbook/assets/screely-1647345516165.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/screely-1647345516165.png -------------------------------------------------------------------------------- /.gitbook/assets/screely-1647345978596.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/screely-1647345978596.png -------------------------------------------------------------------------------- /.gitbook/assets/screely-1647346157966.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/screely-1647346157966.png -------------------------------------------------------------------------------- /.gitbook/assets/screely-1647346291686.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/screely-1647346291686.png -------------------------------------------------------------------------------- /.gitbook/assets/screely-1647346884993.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/screely-1647346884993.png -------------------------------------------------------------------------------- /.gitbook/assets/screely-1647347180148.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/screely-1647347180148.png -------------------------------------------------------------------------------- /.gitbook/assets/screely-1647348882514 (1).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/screely-1647348882514 (1).png -------------------------------------------------------------------------------- /.gitbook/assets/screely-1647348882514.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/screely-1647348882514.png -------------------------------------------------------------------------------- /.gitbook/assets/screely-1647349133522.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/screely-1647349133522.png -------------------------------------------------------------------------------- /.gitbook/assets/screely-1647349298346.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/screely-1647349298346.png -------------------------------------------------------------------------------- /.gitbook/assets/screely-1647349602845.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/screely-1647349602845.png -------------------------------------------------------------------------------- /.gitbook/assets/screely-1647349973601.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/screely-1647349973601.png -------------------------------------------------------------------------------- /.gitbook/assets/screely-1647420837282.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/screely-1647420837282.png -------------------------------------------------------------------------------- /.gitbook/assets/screely-1647421408838.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/screely-1647421408838.png -------------------------------------------------------------------------------- /.gitbook/assets/screely-1647421561951 (1).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/screely-1647421561951 (1).png -------------------------------------------------------------------------------- /.gitbook/assets/screely-1647421561951.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/screely-1647421561951.png -------------------------------------------------------------------------------- /.gitbook/assets/screely-1647422444524.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/screely-1647422444524.png -------------------------------------------------------------------------------- /.gitbook/assets/screely-1647423220677.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/screely-1647423220677.png -------------------------------------------------------------------------------- /.gitbook/assets/screely-1647424115224.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/screely-1647424115224.png -------------------------------------------------------------------------------- /.gitbook/assets/screely-1647424371277.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/screely-1647424371277.png -------------------------------------------------------------------------------- /.gitbook/assets/screely-1647605116883.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/screely-1647605116883.png -------------------------------------------------------------------------------- /.gitbook/assets/screely-1647605231539.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/screely-1647605231539.png -------------------------------------------------------------------------------- /.gitbook/assets/screely-1647605289476.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/screely-1647605289476.png -------------------------------------------------------------------------------- /.gitbook/assets/screely-1647605451432.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/screely-1647605451432.png -------------------------------------------------------------------------------- /.gitbook/assets/screely-1647605782378.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/screely-1647605782378.png -------------------------------------------------------------------------------- /.gitbook/assets/screely-1647606249351.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/screely-1647606249351.png -------------------------------------------------------------------------------- /.gitbook/assets/screely-1649325142630 (1).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/screely-1649325142630 (1).png -------------------------------------------------------------------------------- /.gitbook/assets/screely-1649325142630.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/screely-1649325142630.png -------------------------------------------------------------------------------- /.gitbook/assets/screely-1649325378902.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/screely-1649325378902.png -------------------------------------------------------------------------------- /.gitbook/assets/screenshot_20211020_105434.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/screenshot_20211020_105434.png -------------------------------------------------------------------------------- /.gitbook/assets/screenshot_20211020_111528.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/screenshot_20211020_111528.png -------------------------------------------------------------------------------- /.gitbook/assets/screenshot_20220314_165742.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/screenshot_20220314_165742.png -------------------------------------------------------------------------------- /.gitbook/assets/screenshot_20220315_140544 (1).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/screenshot_20220315_140544 (1).png -------------------------------------------------------------------------------- /.gitbook/assets/screenshot_20220315_140544.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/screenshot_20220315_140544.png -------------------------------------------------------------------------------- /.gitbook/assets/screenshot_20220316_115206.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/screenshot_20220316_115206.png -------------------------------------------------------------------------------- /.gitbook/assets/select-events-svix.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/select-events-svix.png -------------------------------------------------------------------------------- /.gitbook/assets/session_inactivity_timeout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/session_inactivity_timeout.png -------------------------------------------------------------------------------- /.gitbook/assets/session_maximum_lifetime.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/session_maximum_lifetime.png -------------------------------------------------------------------------------- /.gitbook/assets/settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/settings.png -------------------------------------------------------------------------------- /.gitbook/assets/shortcuts.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/shortcuts.png -------------------------------------------------------------------------------- /.gitbook/assets/sign-in (1).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/sign-in (1).png -------------------------------------------------------------------------------- /.gitbook/assets/sign-in.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/sign-in.png -------------------------------------------------------------------------------- /.gitbook/assets/sign-up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/sign-up.png -------------------------------------------------------------------------------- /.gitbook/assets/sms_preview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/sms_preview.png -------------------------------------------------------------------------------- /.gitbook/assets/sms_template_editor (1).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/sms_template_editor (1).png -------------------------------------------------------------------------------- /.gitbook/assets/sms_template_editor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/sms_template_editor.png -------------------------------------------------------------------------------- /.gitbook/assets/sms_template_list.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/sms_template_list.png -------------------------------------------------------------------------------- /.gitbook/assets/sms_template_preview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/sms_template_preview.png -------------------------------------------------------------------------------- /.gitbook/assets/sms_variable_widget.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/sms_variable_widget.png -------------------------------------------------------------------------------- /.gitbook/assets/social-signin-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/social-signin-1.png -------------------------------------------------------------------------------- /.gitbook/assets/social-signin-enable-providers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/social-signin-enable-providers.png -------------------------------------------------------------------------------- /.gitbook/assets/social-signin-hosted-pages-links.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/social-signin-hosted-pages-links.png -------------------------------------------------------------------------------- /.gitbook/assets/social-signin-manage-credentials.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/social-signin-manage-credentials.png -------------------------------------------------------------------------------- /.gitbook/assets/social-signin-mounted-prebuild-signup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/social-signin-mounted-prebuild-signup.png -------------------------------------------------------------------------------- /.gitbook/assets/social-signin-social-login-buttons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/social-signin-social-login-buttons.png -------------------------------------------------------------------------------- /.gitbook/assets/social_all_providers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/social_all_providers.png -------------------------------------------------------------------------------- /.gitbook/assets/social_configuring_google.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/social_configuring_google.png -------------------------------------------------------------------------------- /.gitbook/assets/sync_data_clerk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/sync_data_clerk.png -------------------------------------------------------------------------------- /.gitbook/assets/sync_data_synchronous_clerk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/sync_data_synchronous_clerk.png -------------------------------------------------------------------------------- /.gitbook/assets/text_color.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/text_color.png -------------------------------------------------------------------------------- /.gitbook/assets/twitch-create-oauth-app-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/twitch-create-oauth-app-1.png -------------------------------------------------------------------------------- /.gitbook/assets/twitch-create-oauth-app-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/twitch-create-oauth-app-2.png -------------------------------------------------------------------------------- /.gitbook/assets/twitch-credentials.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/twitch-credentials.png -------------------------------------------------------------------------------- /.gitbook/assets/twitter_auth_settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/twitter_auth_settings.png -------------------------------------------------------------------------------- /.gitbook/assets/twitter_auth_settings_in.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/twitter_auth_settings_in.png -------------------------------------------------------------------------------- /.gitbook/assets/user-button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/user-button.png -------------------------------------------------------------------------------- /.gitbook/assets/user-profile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/user-profile.png -------------------------------------------------------------------------------- /.gitbook/assets/variable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/variable.png -------------------------------------------------------------------------------- /.gitbook/assets/variable_widget.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clerk/docs/caf587f794e96c41bd4cb371ab612de4f4817d89/.gitbook/assets/variable_widget.png -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: Add complete user management to your application in minutes. 3 | --- 4 | 5 | # Welcome to Clerk API Reference 6 | 7 | Dig into our API reference documentation and SDKs. We have everything you need to get started setting up authentication with Clerk. 8 | 9 | {% hint style="info" %} 10 | Questions or feature requests? We're always available on [Discord](https://discord.gg/tF35UMNRuM) or [by email](mailto:support@clerk.dev). 11 | {% endhint %} 12 | 13 | ## API Reference 14 | 15 | Explore our API reference documentation and SDKs to integrate Clerk into your application. 16 | 17 | ### Node SDK 18 | 19 | {% embed url="https://clerk.dev/docs/reference/node/getting-started" %} 20 | 21 | ### Go SDK 22 | 23 | {% embed url="https://clerk.dev/docs/reference/golang/getting-started" %} 24 | 25 | ### Ruby SDK 26 | 27 | {% embed url="https://clerk.dev/docs/reference/ruby/getting-started" %} 28 | 29 | ### Or clone one of our starter repos 30 | 31 | {% embed url="https://github.com/clerkinc" %} 32 | -------------------------------------------------------------------------------- /SUMMARY.md: -------------------------------------------------------------------------------- 1 | # Table of contents 2 | 3 | * [Welcome to Clerk API Reference](README.md) 4 | * [Clerk's Guides and Docs](https://clerk.dev/docs) 5 | * [Questions? We're here for you.](https://www.clerk.dev/support) 6 | 7 | ## API Reference 8 | 9 | * [Frontend API](reference/frontend-api-reference/README.md) 10 | * [Introduction](reference/frontend-api-reference/introduction.md) 11 | * [Client requests](reference/frontend-api-reference/user-api/README.md) 12 | * [Overview](reference/frontend-api-reference/user-api/introduction.md) 13 | * [Client](reference/frontend-api-reference/user-api/client.md) 14 | * [Sign ups](reference/frontend-api-reference/user-api/sign-ups.md) 15 | * [Sign ins](reference/frontend-api-reference/user-api/sign-ins.md) 16 | * [Sessions](reference/frontend-api-reference/user-api/sessions.md) 17 | * [Organization requests](reference/frontend-api-reference/organization-requests/README.md) 18 | * [Organization requests](reference/frontend-api-reference/organization-requests/organization-requests.md) 19 | * [Organization invitations requests](reference/frontend-api-reference/organization-requests/organization-invitations-requests.md) 20 | * [Organization membership requests](reference/frontend-api-reference/organization-requests/organization-membership-requests.md) 21 | * [User requests](reference/frontend-api-reference/users/README.md) 22 | * [Overview](reference/frontend-api-reference/users/introduction.md) 23 | * [Backup codes](reference/frontend-api-reference/users/organizations.md) 24 | * [Current user](reference/frontend-api-reference/users/user.md) 25 | * [Email addresses](reference/frontend-api-reference/users/email-addresses.md) 26 | * [Organizations](reference/frontend-api-reference/users/organizations-1.md) 27 | * [Phone numbers](reference/frontend-api-reference/users/phone-numbers.md) 28 | * [Profile image](reference/frontend-api-reference/users/profile-image.md) 29 | * [Sessions](reference/frontend-api-reference/users/sessions.md) 30 | * [Tokens](reference/frontend-api-reference/users/tokens.md) 31 | * [TOTP](reference/frontend-api-reference/users/organizations-2.md) 32 | * [Well known requests](reference/frontend-api-reference/well-known-requests.md) 33 | -------------------------------------------------------------------------------- /get-started/get-started-with-gatsby.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: Learn to install and initialize Clerk in a new Gatsby application. 3 | --- 4 | 5 | # Get started with Gatsby 6 | 7 | ## Overview 8 | 9 | Clerk is the easiest way to add authentication and user management to your [Gatsby](https://www.gatsbyjs.com) application. This guide will walk you through the necessary steps to install and use Clerk in a new [Gatsby](https://www.gatsbyjs.com) application. 10 | 11 | After following this guide, you should have a working [Gatsby](https://www.gatsbyjs.com) app complete with: 12 | 13 | * Fully fledged sign in and sign up flows. 14 | * Google Social Login. 15 | * Secure email/password authentication. 16 | * A prebuilt user profile page. 17 | 18 | {% hint style="info" %} 19 | Looking for a quickstart? We created a [demo app](https://github.com/clerkinc/clerk-gatsby-starter) to show you how to add Clerk to your project. 20 | {% endhint %} 21 | 22 | ## Before you start 23 | 24 | You need to create a Clerk Application in your [Clerk Dashboard](https://dashboard.clerk.dev). For more information, check out our [Setup your application](../popular-guides/setup-your-application.md) guide. 25 | 26 | ## Installing the plugin 27 | 28 | Once you have a Gatsby app ready, you need to install the [Clerk React SDK](../reference/clerk-react/) and [gatsby-plugin-clerk](https://www.gatsbyjs.com/plugins/gatsby-plugin-clerk). This will give you access to our [prebuilt Clerk Components](broken-reference) and [React hooks](../reference/clerk-react/). 29 | 30 | {% tabs %} 31 | {% tab title="npm" %} 32 | ```bash 33 | # Navigate to your application's root directory 34 | cd your_app 35 | 36 | # Install the necessary Clerk packages 37 | npm install gatsby-plugin-clerk @clerk/clerk-react 38 | ``` 39 | {% endtab %} 40 | 41 | {% tab title="yarn" %} 42 | ```bash 43 | # Navigate to your application's root directory 44 | cd your_app 45 | 46 | # Install the necessary Clerk packages 47 | yarn add gatsby-plugin-clerk @clerk/clerk-react 48 | ``` 49 | {% endtab %} 50 | {% endtabs %} 51 | 52 | As a next step, you'll need the `frontendApi` key of your Clerk application. To find it, go to the [API Keys page](https://dashboard.clerk.dev/last-active?path=api-keys) and copy the **Frontend API Key** field. 53 | 54 | Now, let's configure the plugin on `gatsby-config.js.` 55 | 56 | ```bash 57 | // gatsby-config.js 58 | 59 | module.exports = { 60 | plugins: [ 61 | { 62 | resolve: 'gatsby-plugin-clerk', 63 | options: { 64 | frontendApi: 65 | } 66 | } 67 | ] 68 | } 69 | ``` 70 | 71 | Clerk is now successfully installed 🎉 72 | 73 | From here onwards, everything should work just the same. You can start using components like `SignedIn` and `SignedOut` from the root of your app. 74 | 75 | {% code title="src/pages/index.js" %} 76 | ```jsx 77 | import React from 'react' 78 | import { 79 | SignIn, 80 | SignedIn, 81 | SignedOut, 82 | UserButton 83 | } from '@clerk/clerk-react' 84 | 85 | export default function IndexPage() { 86 | return ( 87 | <> 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | ) 96 | } 97 | 98 | ``` 99 | {% endcode %} 100 | 101 | And that's it, in just a few steps, we added easy and secure authentication with beautiful and complete user management to your Gatsby app. 102 | 103 | ## Clerk + Gatsby starter repository 104 | 105 | To make it even easier for you, we went ahead and created a [Clerk + Gatsby starter repository](https://github.com/clerkinc/clerk-gatsby-starter). It has Clerk integrated with [Gatsby's default starter](https://github.com/gatsbyjs/gatsby-starter-default). 106 | 107 | Inside `src/api` you can also find the new Gatsby Functions in action. We added a couple of examples there, so you know how to use Gatsby's serverless functions with Clerk's backend API. 108 | 109 | Fork it, clone it and build it! 110 | -------------------------------------------------------------------------------- /get-started/nextjs-api.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: >- 3 | This guide will help you authenticate requests made to your Next.js API 4 | routes. 5 | --- 6 | 7 | # Get started with Next.js API 8 | 9 | ## Pre-requirements 10 | 11 | This guide assumes you have properly completed your Next.js [frontend setup](nextjs.md). 12 | 13 | ## Set CLERK\_API\_KEY 14 | 15 | Create a file named **.env.local** in your application root if it doesn't exist already. Any variables inside this file will be accessible in your backend with **process.env.VARIABLE\_NAME**. 16 | 17 | Now, we need to set the `CLERK_API_KEY` environment variable. Go to the [API Keys page](https://dashboard.clerk.dev/last-active?path=api-keys) and copy the **Backend API Key** field. 18 | 19 | {% code title=".env.local" %} 20 | ```jsx 21 | CLERK_API_KEY=test_asdf1234 22 | ``` 23 | {% endcode %} 24 | 25 | ## Use the @clerk/nextjs/api 26 | 27 | The `@clerk/nextjs` package comes with all the Next.js API methods for using Clerk exported at `@clerk/nextjs/api`. 28 | 29 | ```typescript 30 | /** Next.js API imports for Clerk. */ 31 | import { ... } from "@clerk/nextjs/api"; 32 | ``` 33 | 34 | ## Create an API route 35 | 36 | In Next.js, API routes are created by adding a file to the **pages/api** folder. The filename is used as the API path. New Next.js applications come with a **pages/api/hello.js** file that we can edit. 37 | 38 | {% code title="pages/api/hello.js" %} 39 | ```jsx 40 | import { requireAuth } from "@clerk/nextjs/api"; 41 | 42 | export default requireAuth((req, res) => { 43 | res.statusCode = 200; 44 | res.json({ id: req.session.userId }); 45 | }); 46 | ``` 47 | {% endcode %} 48 | 49 | That's it! Now, if a user is signed in, requests to **/api/hello** will return that user's ID. This ID will never change for this user, so you can use it as a stable user ID in your own codebase. 50 | 51 | If a user is signed out, the **requireAuth** helper will automatically return with HTTP status 401 and no response body. If you'd prefer to process a request when there is no user, try the **withAuth** helper instead: 52 | 53 | {% code title="pages/api/hello.js" %} 54 | ```jsx 55 | import { withAuth } from "@clerk/nextjs/api"; 56 | 57 | export default withAuth((req, res) => { 58 | res.statusCode = 200; 59 | if (req.session){ 60 | res.json({ id: req.session.userId }); 61 | } else { 62 | res.json({ id: null }); 63 | } 64 | }); 65 | ``` 66 | {% endcode %} 67 | -------------------------------------------------------------------------------- /get-started/redwoodjs.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: Learn how to install Clerk in a RedwoodJS application 3 | --- 4 | 5 | # Get started with RedwoodJS 6 | 7 | ### Overview 8 | 9 | RedwoodJS is an opinionated, full-stack web application framework focused on providing an integrated developer experience from build to deployment. It follows standard-based conventions with an eye towards the modern architecture of Jamstack and serverless apps. 10 | 11 | Although Redwood contains a built-in authentication system (dbAuth), it requires that you manage the user database yourself and does not provide features like social SSO, passwordless authentication, and multi-session management. Clerk provides these features and more without the hassle of managing your own user auth service. 12 | 13 | The Clerk integration with Redwood enables you to focus on building the frontend and GraphQL API aspects of your application without needing to add database fields to the Users table and maintain a secret key to encrypt the session cookie. It’s nice to not have to be concerned with these things. 14 | 15 | This guide will walk you through the necessary steps to integrate Clerk as the external authentication provider for RedwoodJS. 16 | 17 | {% hint style="info" %} 18 | Looking for a quickstart? We created a [demo app](https://github.com/clerkinc/clerk-redwood-starter) to show you how to add Clerk to your project. 19 | {% endhint %} 20 | 21 | ### Getting started 22 | 23 | The first step is to create a new Clerk application from your [Clerk Dashboard](https://dashboard.clerk.dev) if you haven’t done so already. You can choose whichever authentication strategy and social login providers you prefer. For more information, check out our [Set up your application](../popular-guides/setup-your-application.md) guide. 24 | 25 | Now, we need to retrieve your API keys from the [API Keys page](https://dashboard.clerk.dev/last-active?path=api-keys). 26 | 27 | In your Redwood app directory, create a `.env` file (if one does not currently exist) and set the following environment variables to the respective values from your Clerk dashboard: 28 | 29 | ```bash 30 | CLERK_API_KEY= 31 | CLERK_FRONTEND_API_URL= 32 | ``` 33 | 34 | In order for the Frontend API to be accessible to the Web side in production, you need to add `CLERK_FRONTEND_API_URL` to the `includeEnvironmentVariables` array in the `redwood.toml` file: 35 | 36 | ```jsx 37 | // redwood.toml 38 | 39 | [web] 40 | includeEnvironmentVariables = ['CLERK_FRONTEND_API_URL'] 41 | ``` 42 | 43 | ### Set up auth 44 | 45 | The next step is to run a [Redwood CLI command](https://redwoodjs.com/docs/authentication.html#clerk) to install the required packages and generate some boilerplate code: 46 | 47 | ```bash 48 | yarn rw setup auth clerk --force 49 | ``` 50 | 51 | **Note**: The `--force` flag is needed to overwrite the existing dbAuth logic. 52 | 53 | You should see terminal output similar to the following: 54 | 55 | ```bash 56 | ✔ Generating auth lib... 57 | ✔ Successfully wrote file `./api/src/lib/auth.js` 58 | ✔ Adding auth config to web... 59 | ✔ Adding auth config to GraphQL API... 60 | ✔ Adding required web packages... 61 | ✔ Adding required api packages... 62 | ✔ Installing packages... 63 | ✔ One more thing... 64 | 65 | You will need to add two environment variables with your Clerk URL and API key. 66 | Check out web/src/App.{js,tsx} for the variables you need to add. 67 | See also: 68 | ``` 69 | 70 | If you already followed the instructions to add your environment variables, you should be all set. If you didn’t, add them now. 71 | 72 | In your code editor of choice, open up `web/src/App.tsx` (or `App.js` if you’re not using TypeScript). 73 | 74 | Wrap the Redwood `` component with `` 75 | 76 | ```jsx 77 | const App = () => ( 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | ) 90 | ``` 91 | 92 | ### Add Clerk components and hooks 93 | 94 | Now that Clerk auth is set up, restart the dev server with `yarn rw dev`. If you had the dev server running, it must be restarted to read the newly added environment variables. 95 | 96 | You can now access Clerk functions through the Redwood `useAuth()` hook or you can use the Clerk components directly. 97 | 98 | For example, you can write: 99 | 100 | ```jsx 101 | import { useAuth } from '@redwoodjs/auth' 102 | 103 | const HomePage = () => { 104 | const { currentUser, isAuthenticated, logIn, logOut } = useAuth() 105 | 106 | return ( 107 | <> 108 | {isAuthenticated ? ( 109 | 110 | ) : ( 111 | 112 | )} 113 | {isAuthenticated &&

Hello {currentUser.firstName}

} 114 | 115 | ) 116 | } 117 | 118 | export default HomePage 119 | ``` 120 | 121 | The `isAuthenticated` property checks if there is an active user session. Clicking the “Log in” button opens a modal window allowing you to sign in with the authentication methods chosen when you set up the project in the Clerk dashboard. 122 | 123 | Since Clerk React is installed, you can use the Clerk components instead: 124 | 125 | ```jsx 126 | import { SignInButton, UserButton } from '@clerk/clerk-react' 127 | import { useAuth } from '@redwoodjs/auth' 128 | 129 | const HomePage = () => { 130 | const { currentUser, isAuthenticated } = useAuth() 131 | 132 | return ( 133 | <> 134 | {isAuthenticated ? ( 135 | 136 | ) : ( 137 | 138 | )} 139 | {isAuthenticated &&

Hello {currentUser.firstName}

} 140 | 141 | ) 142 | } 143 | 144 | export default HomePage 145 | ``` 146 | 147 | Clerk makes it super easy to add in these authentication components. There are further options for customization available as well. 148 | 149 | ### Next steps 150 | 151 | * Get started with our official [clerk-redwood-starter](https://github.com/clerkinc/clerk-redwood-starter) repo 152 | * Check out our [RedwoodJS Blog Tutorial with Clerk](https://clerk.dev/tutorials/redwoodjs-blog-tutorial-with-clerk) 153 | * Learn more about the [Redwood Authentication API](https://redwoodjs.com/docs/authentication#api) 154 | * Update the Sign In and Sign Up pages with [mounted Clerk components](../components/sign-in/sign-in.md) 155 | * Get support or at least say hi in our [Discord channel](https://discord.com/invite/b5rXHjAg7A) 👋 156 | -------------------------------------------------------------------------------- /get-started/remix.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: Learn to install and initialize Clerk in a Remix application. 3 | --- 4 | 5 | # Get started with Remix 6 | 7 | ## Overview 8 | 9 | {% hint style="info" %} 10 | Remix support is still in beta and the APIs presented below are subject to change. Please report any feedback, issues, or ideas [to support](https://clerk.dev/support) - we'd love to hear from you! 11 | {% endhint %} 12 | 13 | Clerk is the easiest way to add authentication and user management to your [Remix](https://remix.run) application. This guide will walk you through the necessary steps to install and use Clerk in a new Next.js application. 14 | 15 | After following this guide, you should have a working Remix app complete with: 16 | 17 | * Fully fledged sign up and sign in flows. 18 | * Social Login with the vendors of your choice (Google, Twitter, etc) 19 | * Secure password or passwordless authentication. 20 | * A prebuilt user profile page. 21 | 22 | {% hint style="info" %} 23 | Looking for a quickstart? We created a [demo app](https://github.com/clerkinc/clerk-remix-starter) to show you how to add Clerk to your project. 24 | {% endhint %} 25 | 26 | ## Before you start 27 | 28 | You need to create a Clerk Application in your [Clerk Dashboard](https://dashboard.clerk.dev). For more information, check out our [Setup your application](../popular-guides/setup-your-application.md) guide. 29 | 30 | ## Creating a new Remix app 31 | 32 | If you haven't done so already, start by creating a new Remix application 33 | 34 | ``` 35 | npx create-remix@latest 36 | ``` 37 | 38 | For more information, you can reference the [Remix documentation](https://remix.run/docs/en/v1/tutorials/blog). 39 | 40 | ## Install @clerk/remix 41 | 42 | Once you have a Remix app ready, you need to install the Clerk Remix SDK. This will give you access to our prebuilt Clerk Components and React hooks. 43 | 44 | ``` 45 | npm install @clerk/remix@next 46 | ``` 47 | 48 | Now, we need to retrieve your Backend API Key from the [API Keys page](https://dashboard.clerk.dev/last-active?path=api-keys). 49 | 50 | Remix allows developers to set environment variables by creating a `.env` file in their application root. Add Clerk's environment variables as follows: 51 | 52 | ```bash 53 | # Replace [your-frontend-api] with the actual Frontend API key 54 | echo "CLERK_FRONTEND_API=[your-frontend-api]" > .env 55 | # Replace [your-backend-api-key] with the actual Backend API key 56 | echo "CLERK_API_KEY=[your-backend-api-key]" > .env 57 | ``` 58 | 59 | Clerk is now installed, but still needs to be initialized. We can go ahead and start the development server: 60 | 61 | ``` 62 | npm run dev 63 | ``` 64 | 65 | ## Initialize Clerk in app/root.tsx 66 | 67 | In Remix, `app/root.tsx` wraps your entire application in both server and browser contexts. Clerk requires three modifications to this file so we can share the authentication state with your Remix routes. 68 | 69 | ### Set \`rootAuthLoader\` 70 | 71 | First, we must define a root loader. 72 | 73 | ```javascript 74 | import { rootAuthLoader } from "@clerk/remix/ssr.server"; 75 | 76 | export const loader: LoaderFunction = (args) => rootAuthLoader(args); 77 | ``` 78 | 79 | If you'd like to load additional data, you can pass your own loader directly to `rootAuthLoader`. 80 | 81 | ```javascript 82 | import { rootAuthLoader } from "@clerk/remix/ssr.server"; 83 | 84 | export const loader: LoaderFunction = (args) => 85 | rootAuthLoader(args, ({ params, request, context, auth }) => { 86 | // auth.userId will be set if there is a signed in user 87 | return { yourData: "here" }; 88 | }); 89 | ``` 90 | 91 | ### Connect Clerk to React 92 | 93 | Clerk provides a `ConnectClerk` helper to provide the authentication state to your React tree. This helper works with SSR out-of-the-box and follows the "higher-order component" paradigm. 94 | 95 | First, update App so it is not exported as the default module: 96 | 97 | ```javascript 98 | // Remove "export default" from in front of `function App() {` 99 | function App() { 100 | ... 101 | } 102 | ``` 103 | 104 | Then, wrap `App` with `ConnectClerk` and pass in your `frontendApi` variable from your instance dashboard: 105 | 106 | ```javascript 107 | import { ConnectClerk } from "@clerk/remix"; 108 | 109 | export default ConnectClerk(App); 110 | ``` 111 | 112 | ### Connect Clerk to the Catch Boundary 113 | 114 | Clerk uses Remix's catch boundary to refresh expired authentication tokens. 115 | 116 | ```java 117 | import { ConnectClerkCatchBoundary } from "@clerk/remix"; 118 | 119 | export const CatchBoundary = ConnectClerkCatchBoundary(); 120 | ``` 121 | 122 | You can add your own boundary simply by passing it as an argument. 123 | 124 | ```jsx 125 | export const CatchBoundary = ConnectClerkCatchBoundary(YourBoundary); 126 | ``` 127 | 128 | That's everything! The rest of your application can now leverage authentication as needed. 129 | 130 | ## Using authentication state 131 | 132 | Now that your `root.tsx` is configured, you can use the user's authentication information anywhere in your application. 133 | 134 | ### In loaders and actions 135 | 136 | Use the `getAuth` helper to retrieve the user ID and session ID from a loader or action. Most commonly, developers only require the user ID, while the session ID my be helpful auditing use cases. 137 | 138 | ```javascript 139 | import { getAuth } from "@clerk/remix/ssr.server"; 140 | 141 | export const loader: LoaderFunction = async ({ request }) => { 142 | const { userId, sessionId } = await getAuth(request); 143 | 144 | // Your loader here 145 | } 146 | ``` 147 | 148 | ### In React 149 | 150 | In React, the same information is available via the `useAuth` hook: 151 | 152 | ```javascript 153 | import { useAuth } from "@clerk/remix"; 154 | 155 | const { userId, sessionId } = useAuth(); 156 | ``` 157 | 158 | A complete reference to our React helpers is [available here](broken-reference). 159 | 160 | ## Protecting routes 161 | 162 | To protect a route from signed out users, simply add a redirect to your loader if no `userId` is found in the authentication state: 163 | 164 | ```jsx 165 | export const loader: LoaderFunction = async ({ request }) => { 166 | const { userId, sessionId } = await getAuth(request); 167 | if(!auth.userId){ 168 | return redirect("https://accounts.foo.bar.lcl.dev/sign-in"); 169 | } 170 | // Your loader here 171 | } 172 | ``` 173 | 174 | ## Demo repository 175 | 176 | [Clerk Remix Demo Repository](https://github.com/nikosdouvlis/clerk-remix-demo) 177 | -------------------------------------------------------------------------------- /integrations/bubble.io-beta.md: -------------------------------------------------------------------------------- 1 | # bubble.io (beta) 2 | 3 | This integration allows you to use Clerk as the authentication and user management solution for your [bubble.io](https://bubble.io) sites. Add social logins, passwordless auth, multi-factor auth, the familiar user profile button, and more all without code. 4 | 5 | {% hint style="info" %} 6 | **The bubble.io plugin is currently in closed beta.** To get access to the official Clerk plugin, reach out to us on any of our [support channels](https://clerk.dev/support) so we can add you to the beta. 7 | {% endhint %} 8 | 9 | ## 1. Install the official bubble.io Clerk plugin 10 | 11 | To get access to the official Clerk plugin, reach out to us on any of our [support channels](https://clerk.dev/support) so we can add you to the beta. 12 | 13 | ### 1.1 Add the FRONTEND\_API key 14 | 15 | After you install the Clerk plugin, add the `FRONTEND_API` key for your instance. 16 | 17 | _You can find this value on your instance's **Home** page. For more information, go to our_ [_**Frontend API**_](../reference/frontend-api-reference/) _****_ documentation. 18 | 19 | ## 2. Automatic sign-up/log-in workflow 20 | 21 | For Clerk to work with bubble's sign-up/log-in mechanism, you need to add the Clerk workflow. All actions come from the base bubble _Account_ type. The final result of workflow will look like this: 22 | 23 | ![Clerk base workflow](<../.gitbook/assets/Screenshot 2021-07-27 at 9.34.33 AM.png>) 24 | 25 | The workflow must be triggered from ClerkProvider's _"Clerk loaded with user"_ event. 26 | 27 | ### The ClerkProvider element 28 | 29 | In order to use Clerk on your page, first you need to add the **ClerkProvider** element. It can go anywhere, and does not display anything. 30 | 31 | To create the workflow follow these steps: 32 | 33 | ### Step 1 - Create an account for someone else 34 | 35 | ![](../.gitbook/assets/bubble.io\_page\_type=custom\&name=Header\&id=peter-clerk-test-app\&test\_plugin=1626444962690x347764556487458800\_current\&tab=tabs-2.png) 36 | 37 | ### Step 2 - Assign a temp password to a user 38 | 39 | ![](<../.gitbook/assets/bubble.io\_page\_type=custom\&name=Header\&id=peter-clerk-test-app\&test\_plugin=1626444962690x347764556487458800\_current\&tab=tabs-2 (1).png>) 40 | 41 | ### Step 3 - Log the user in 42 | 43 | ![](<../.gitbook/assets/bubble.io\_page\_type=custom\&name=Header\&id=peter-clerk-test-app\&test\_plugin=1626444962690x347764556487458800\_current\&tab=tabs-2 (2).png>) 44 | 45 | That's it! Now bubble will recognize your users, and you can use Clerk elements and actions throughout your page. 46 | 47 | ## 3. Sign out workflow 48 | 49 | For sign out to work, you will need to sign out of both Clerk and bubble. An example sign out workflow is as follows: 50 | 51 | ![](<../.gitbook/assets/Screenshot 2021-07-27 at 11.37.25 AM.png>) 52 | 53 | When the _Signout_ button is clicked, the action "_Account_ **→**_Log the user out"_ is triggered along with the "_Clerk **→** Signout"_ action. 54 | 55 | ## 4. (Preview-only) URL Redirects 56 | 57 | In bubble's preview environment, your app will be running on the following URL: `/version-test?debug_mode=true`. In order to make Clerk work during preview mode, you need to redirect here after adjust your **Redirects** in the Clerk dashboard to point to this value. 58 | 59 | 60 | 61 | Under **Paths** enter `/version-test?debug_mode=true` for the following fields: 62 | 63 | * Sign up redirect URL 64 | * Sign in redirect URL 65 | * Sign-out redirect, single account URL 66 | 67 | The final result should look like this: 68 | 69 | ![](../.gitbook/assets/screely-1639508959537.png) 70 | 71 | ## Actions 72 | 73 | The Clerk plugin includes basic actions that allow you to link sign-up, log-in and sign-out processes to your page elements. 74 | 75 | #### OpenSignup 76 | 77 | The _OpenSignup_ action will open the Clerk sign-up modal. 78 | 79 | #### OpenSignin 80 | 81 | The _OpenSignin_ action will open the Clerk sign-in modal. 82 | 83 | #### Signout 84 | 85 | The _Signout_ action will sign out the active user. 86 | 87 | ## Elements 88 | 89 | The Clerk plugin includes pre-built elements that can enhance your application's user experience. 90 | 91 | ### ClerkProvider 92 | 93 | The _ClerkProvider_ element is the base building block for the integration between your page and Clerk. For actions and workflows to function properly, you need to add a ClerkProvider element anywhere on your page so that actions can reference it. 94 | 95 | This element does not display anything. 96 | 97 | ### UserButton 98 | 99 | The _UserButton_ element gives your users an easy way to manage their account(s). 100 | 101 | ![](<../.gitbook/assets/image (2).png>) 102 | 103 | {% hint style="info" %} 104 | _The element should not be visible on page load, as shown below._ 105 | {% endhint %} 106 | 107 | ![](../.gitbook/assets/bubble.io\_page\_type=custom\&name=Header\&id=peter-clerk-test-app\&test\_plugin=1626444962690x347764556487458800\_current\&tab=tabs-1.png) 108 | 109 | To show the _UserButton_, add a new workflow using a_"Clerk loaded with user"_ event. This workflow will show the _UserButton_ once Clerk has fully loaded. Here's what this workflow will look like: 110 | 111 | ![](<../.gitbook/assets/image (1).png>) 112 | 113 | ## Frequently Asked Questions 114 | 115 | * **Where can I manage my application's users?**\ 116 | ****Users can be managed from the [Users page](https://dashboard.clerk.dev/last-active?path=users).\ 117 | 118 | * **Can I change the Clerk interface theme to match my application ?**\ 119 | ****Yes! Navigate to the [Theme page](https://dashboard.clerk.dev/last-active?path=customization/theme) for complete customizability. _Don't forget to press the Apply changes button!_ 120 | * **Can I migrate all my existing bubble.io users to Clerk ?**\ 121 | ****Yes! [Contact us](https://clerk.dev/support) and we can help you migrate your existing user base. 122 | 123 | If you have any questions, feature requests, or bug reports, feel free to [contact us](https://clerk.dev/support) at any time! 124 | -------------------------------------------------------------------------------- /integrations/firebase.md: -------------------------------------------------------------------------------- 1 | # Firebase 2 | 3 | This integration configures Clerk as a [custom authentication system](https://firebase.google.com/docs/auth/web/custom-auth?authuser=0#web-v8) for your Firebase services. It enables Clerk-managed users to authenticate and interact directly with Firebase's suite of tools, including Realtime Database, Cloud Functions, and Cloud Storage. 4 | 5 | We have an example application showcasing how to integrate Clerk with Firebase, check it out [https://github.com/clerkinc/clerk-firebase-starter](https://github.com/clerkinc/clerk-firebase-starter). 6 | 7 | ## 1. Turn on the integration 8 | 9 | To enable the integration, you will need to provide Clerk with the required Firebase configuration attributes depending on the Firebase features you would require authenticated user access to. 10 | 11 | To get started, turn on the Firebase integration on the [Integrations page](https://dashboard.clerk.dev/last-active?path=integrations). 12 | 13 | ## 2. Integration configuration 14 | 15 | To allow Clerk to generate the required authentication token for Firebase, you will need to set some configuration attributes on the Clerk integration page. 16 | 17 | ### 2.1 (Easy way) Upload a JSON Firebase configuration file 18 | 19 | You can upload the JSON configuration file you will retrieve from Firebase directly on the Firebase integration page, and the required fields will be filled automatically. 20 | 21 | * To get the Firebase JSON configuration file, you can follow the step-by-step instructions: 22 | 23 | {% embed url="https://www.youtube.com/watch?v=5H8RxeBVV5g" %} 24 | Upload Service Account JSON file on Clerk 25 | {% endembed %} 26 | 27 | * To upload the file on Clerk, use the **Upload JSON** button on the Firebase integration page: 28 | 29 | ![](../.gitbook/assets/screely-1639508509124.png) 30 | 31 | ### 2.2 Fill the required attributes manually 32 | 33 | The attributes that you need to fill in to connect Clerk with Firebase, as a custom authentication system, are described below: 34 | 35 | * **Service account ID**\ 36 | ****The service account ID can be found in the [Google Cloud Console](https://console.cloud.google.com/iam-admin/serviceaccounts?consoleUI=FIREBASE\&hl=fi) for your Firebase project, or in the `client_email` field of a service account JSON file. 37 | * **Project ID**\ 38 | ****The Firebase project ID is the unique identifier of your Firebase project. Can be found under the Project Settings in the Firebase platform. 39 | * **Database URL** (_Optional_)\ 40 | ****The Firebase Realtime Database URL as retrieved from the Firebase platform under the **Realtime Database** page. 41 | * **Private Key**\ 42 | ****The private key used for signing which belongs to the Google service account ID of your project. Can be found in the [Google Cloud Console](https://console.cloud.google.com/iam-admin/serviceaccounts?consoleUI=FIREBASE\&hl=fi) for your Firebase project, or in the `private_key` field of a service account JSON file. 43 | 44 | ## 3. Firebase user sign-in with Clerk as an authentication provider 45 | 46 | After successfully completing the integration setup on your dashboard, you should setup your frontend to connect Clerk with the Firebase authentication system. 47 | 48 | ### **3.1 Retrieve a Firebase user authentication token from Clerk** 49 | 50 | The Firebase Web SDK requires an authentication token to sign-in your users using Clerk. This token can be retrieved calling the `getToken` method of the [User object](../reference/clerkjs/user.md#gettoken) for the Firebase provider. 51 | 52 | ```javascript 53 | await user.getToken("firebase"); 54 | ``` 55 | 56 | The above method will return the token needed for the Firebase Web SDK to sign-in your users with Clerk. 57 | 58 | ### 3.2 Sign-in using the Firebase Web SDK 59 | 60 | {% hint style="info" %} 61 | The Firebase Web SDK referenced, is the browser installation of the Firebase official package on [npm](https://www.npmjs.com/package/firebase). 62 | {% endhint %} 63 | 64 | To authenticate your users on Firebase using Clerk you would need to call the `signInWithCustomToken` method of the Firebase Auth scope. 65 | 66 | {% tabs %} 67 | {% tab title="Web SDK v8" %} 68 | ```javascript 69 | import firebase from "firebase"; 70 | 71 | await firebase 72 | .auth() 73 | .signInWithCustomToken(clerkCustomToken); 74 | ``` 75 | {% endtab %} 76 | 77 | {% tab title="Web SDK v9" %} 78 | ```javascript 79 | import { getAuth, signInWithCustomToken } from "firebase/auth"; 80 | 81 | const auth = getAuth(); 82 | await signInWithCustomToken(auth, clerkCustomToken); 83 | ``` 84 | {% endtab %} 85 | {% endtabs %} 86 | 87 | A mostly complete showcase using [@clerk/clerk-react](../reference/clerk-react/installation.md): 88 | 89 | {% tabs %} 90 | {% tab title="@clerk/clerk-react" %} 91 | {% code title="Component.tsx" %} 92 | ```jsx 93 | /** Rest imports */ 94 | import firebase from "firebase"; 95 | import { useUser } from "@clerk/clerk-react"; 96 | 97 | function Component(){ 98 | const user = useUser(); 99 | 100 | /** Example effect */ 101 | useEffect(() => { 102 | const signInWithClerk = async function(){ 103 | const firebaseClerkToken = await user.getToken("firebase"); 104 | const userCredentials = await firebase 105 | .auth() 106 | .signInWithCustomToken(firebaseClerkToken); 107 | /** 108 | * The userCredentials.user object will call the methods of 109 | * the Firebase platform as an authenticated user. 110 | */ 111 | } 112 | 113 | signInWithClerk(); 114 | }, []); 115 | 116 | return

Clerk-Firebase integration!

117 | } 118 | ``` 119 | {% endcode %} 120 | {% endtab %} 121 | {% endtabs %} 122 | -------------------------------------------------------------------------------- /integrations/google-analytics.md: -------------------------------------------------------------------------------- 1 | # Google Analytics 2 | 3 | This integration enables Clerk to send user authentication events to the configured Google Analytics property which corresponds to your application. 4 | 5 | {% hint style="info" %} 6 | The Google Analytics integration can be enabled only for Production Instances. 7 | {% endhint %} 8 | 9 | ## 1. Turn on the integration 10 | 11 | To enable the integration, you will need to provide Clerk with the required Google Analytics configuration attributes depending on the type of Google Analytics property. **We support both Universal Analytics and Google Analytics 4 properties.** 12 | 13 | To get started, turn on the Google Analytics integration on the [Integrations page](https://dashboard.clerk.dev/last-active?path=integrations). 14 | 15 | ![](../.gitbook/assets/screely-1639509148300.png) 16 | 17 | ## 2. Integration configuration 18 | 19 | To allow Clerk to report selected events on your Google Analytics property and improve your user analytics quality, you will need to set some configuration attributes on the integration page. 20 | 21 | ### 2.1 Reporting API credentials 22 | 23 | To send events to Google Analytics servers, Clerk uses the [Measurement Protocol](https://developers.google.com/analytics/devguides/collection/protocol/v1) specification. Depending on your property type, you would need to provide the keys as described below: 24 | 25 | #### Google Analytics 4 26 | 27 | * **API Secret**\ 28 | \*\*\*\*An API secret generated in the Google Analytics UI. To create a new secret, navigate to:\ 29 | **Admin → Data Streams → choose your stream → Measurement Protocol → Create** 30 | 31 | ![API Secret generation](../.gitbook/assets/api\_secret.gif) 32 | 33 | * **Measurement ID**\ 34 | \*\*\*\*The measurement ID associated with the data stream sending data to your Google Analytics 4 property. The format is _G-XXXXXXX_ and can be found in the Google Analytics UI under:\ 35 | **Admin** **→** **Data Streams** **→** **choose your stream** **→** **Measurement ID** 36 | 37 | ![Measurement ID](../.gitbook/assets/measurement\_id.gif) 38 | 39 | #### Universal Analytics 40 | 41 | * **Tracking ID**\ 42 | \*\*\*\*The tracking ID is a string composed of your account number and the property index and is used to send data to the correct Google Analytics property. The format is _UA-YYYYYY-Z_ and can be found in the Google Analytics UI under:\ 43 | **Admin → Tracking Info → Tracking Code**\\ 44 | 45 | *** 46 | 47 | ![Tracking ID](<../.gitbook/assets/image (5).png>) 48 | 49 | ### 2.2 Include Clerk User ID 50 | 51 | Since Clerk is used for the user management and authentication in your application, we provide the capability to associate the user identifier generated from Clerk with the User Id feature in Google Analytics. Enabling this feature will allow enhanced user analysis capablities on Google Analytics like cross-device user tracking, session unification and more. 52 | 53 | Read more about the User ID feature:\ 54 | [Google Analytics 4 User-ID\ 55 | ](https://support.google.com/analytics/answer/9213390)[Universal Analytics User-ID](https://support.google.com/analytics/answer/3123662?hl=en) 56 | 57 | ### 2.3 Events to track 58 | 59 | Select during which user authentication events such as user sign-in or user sign-up, a Google Analytics event should be recorded. 60 | 61 | * **Sign up**\ 62 | \*\*\*\*Sent every time a user signs up for your application through Clerk.\\ 63 | * For **Universal Analytics** properties, this is sent as a custom event.\ 64 | The custom event is composed as:\ 65 | Category: _**Clerk**_\ 66 | Action: _**sign\_up**_\ 67 | \_\_Label: **\{{signup method\}}**\\ 68 | * For **Google Analytics 4** properties, this matches the standard [sign\_up event](https://developers.google.com/analytics/devguides/collection/ga4/reference/events#sign\_up). \\ 69 | * **Sign in**\ 70 | \*\*\*\*Sent every time a user signs in to his account through Clerk.\\ 71 | * For **Universal Analytics properties**, this is sent as a custom event. 72 | 73 | Category: _**Clerk**_\ 74 | Action: _**login**_\ 75 | \_\_Label: **\{{login method\}}** 76 | 77 | *** 78 | * For **Google Analytics 4** properties, this matches the standard [login event](https://developers.google.com/analytics/devguides/collection/ga4/reference/events#login). 79 | 80 | ## Frequently Asked Questions 81 | 82 | * **Will Clerk events disrupt **_**\*\*\*\***_** session attribution, user count or other metrics ?**\ 83 | \*\*\*\*No, Clerk's production architecture allows us to configure the measurement protocol events sent to your property in such a way that session attribution, user count and identification attributes are kept intact.\ 84 | \ 85 | _The only **caveat** in this case is if your authentication domain is regarded as **cross-domain** to the main application domain. If that is the case, feel free to contact us and we will try our best to guide you through a resolution._ 86 | -------------------------------------------------------------------------------- /integrations/hasura.md: -------------------------------------------------------------------------------- 1 | # Hasura 2 | 3 | The Clerk integration with Hasura enables you to authenticate requests to Hasura using a JSON Web Token (JWT) created with our [JWT Templates](https://docs.clerk.dev/popular-guides/jwt-templates) feature. 4 | 5 | We have an official starter repo with Next.js and Hasura, check it out [here](https://github.com/clerkinc/clerk-hasura-starter). 6 | 7 | ### Getting started 8 | 9 | You can connect your Clerk-authenticated application to a Hasura GraphQL endpoint within minutes. 10 | 11 | The first step is to navigate to **JWT Templates** from the Clerk Dashboard. 12 | 13 | Click on the button to create a New Template based on Hasura. 14 | 15 | ![](../.gitbook/assets/hasura-template.png) 16 | 17 | This will pre-populate the default claims required by Hasura. You can include additional claims or modify them as necessary. [Shortcodes](https://docs.clerk.dev/popular-guides/jwt-templates#shortcodes) are also available to make adding dynamic user values easy. 18 | 19 | ![](../.gitbook/assets/hasura-token-claims.png) 20 | 21 | By default, Clerk will sign the JWT with a private key automatically generated for your application, which is what most developers use for Hasura. If you so choose, you can customize this key. 22 | 23 | ### Configure Hasura 24 | 25 | The next step is to provide Hasura with the public keys used to verify the JWT issued by Clerk. Assuming you didn’t use a [custom key](hasura.md#with-custom-signing-key), this can be done by using a JSON Web Key Set (JWKS), which Clerk automatically creates an endpoint for with your Frontend API (`https:///.well-known/jwks.json`). 26 | 27 | You can set up your project either with Hasura Cloud or you can [run the Hasura GraphQL engine locally using Docker Compose](https://hasura.io/docs/latest/graphql/core/getting-started/docker-simple.html#docker-simple). 28 | 29 | #### Set up with Hasura Cloud 30 | 31 | Go to your project settings, click “Env vars” and then add “New Env Var.” 32 | 33 | Set the key to `HASURA_GRAPHQL_JWT_SECRET` and value to the following: 34 | 35 | ```json 36 | {"jwk_url":"https:///.well-known/jwks.json"} 37 | ``` 38 | 39 | Replace `` with the Frontend API value from your Clerk instance dashboard. 40 | 41 | ![](../.gitbook/assets/hasura-env-vars.png) 42 | 43 | #### Set up with Hasura Core 44 | 45 | To add the JWT secret locally with Hasura Core, you need to set both the `HASURA_GRAPHQL_ADMIN_SECRET` and `HASURA_GRAPHQL_JWT_SECRET` in the `docker-compose.yml` file. 46 | 47 | `HASURA_GRAPHQL_ADMIN_SECRET` can be set to any text string. 48 | 49 | `HASURA_GRAPHQL_JWT_SECRET` should be set to a stringified JSON object of the JWT secret which contains the JWKS endpoint as the value of `jwk_url`. 50 | 51 | ```yaml 52 | HASURA_GRAPHQL_ADMIN_SECRET: myadminsecretkey 53 | HASURA_GRAPHQL_JWT_SECRET: '{"jwk_url":"https:///.well-known/jwks.json"}'. 54 | ``` 55 | 56 | Replace `` with the Frontend API value from your Clerk instance dashboard. 57 | 58 | #### With Custom Signing Key 59 | 60 | If you did use a custom signing key, instead of providing the `jwk_url` you need to provide the algorithm `type` and `key` in the stringified JSON object as the `HASURA_GRAPHQL_JWT_SECRET` in the Hasura Cloud Env Vars or in the `docker-compose.yml` file. 61 | 62 | ```yaml 63 | HASURA_GRAPHQL_JWT_SECRET: '{"type": "HS256", "key": "" }' 64 | ``` 65 | 66 | ### **Configure your GraphQL client** 67 | 68 | GraphQL clients (such as [Apollo Client](https://github.com/apollographql/apollo-client) and [Relay](https://github.com/facebook/relay)) can help with querying and caching your data. They can also manage UI state, keep data in sync, and boost performance. That said, you can make a GraphQL request to the Hasura backend with the native browser [Fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch\_API). 69 | 70 | The last step of integrating Clerk as the modern web authentication solution for Hasura is to pass the JWT in the `Authorization` header with your requests. You can access the token generated with the Hasura claims by calling `getToken({ template: })` on the Session object with the name of your template. 71 | 72 | Even if you don’t have a database table set up yet, we can make use of the [built-in GraphQL introspection system](https://graphql.org/learn/introspection/) to validate that the authenticated requests are working properly. 73 | 74 | Here is an example of using Fetch in conjunction with the `useSWR` hook in a Next.js application to make a request to the Hasura GraphQL endpoint: 75 | 76 | ```jsx 77 | import { useSession } from '@clerk/nextjs'; 78 | import useSWR from 'swr'; 79 | 80 | // This component needs to be a child of and 81 | // in order to access the authenticated session object 82 | const Main = () => { 83 | const { getToken } = useSession(); 84 | const endpoint = process.env.NEXT_PUBLIC_HASURA_GRAPHQL_API; 85 | const query = `query { __schema { types { name } } }`; 86 | const fetcher = async (...args) => 87 | fetch(...args, { 88 | method: 'POST', 89 | headers: { 90 | 'Content-Type': 'application/json', 91 | Accept: 'application/json', 92 | Authorization: `Bearer ${await getToken({ template: 'hasura' })}` 93 | }, 94 | body: JSON.stringify({ query }) 95 | }).then(res => res.json()); 96 | 97 | const { data } = useSWR(endpoint, fetcher); 98 | 99 | return

GraphQL schema has {data?.data?.__schema.types.length} types

; 100 | }; 101 | 102 | export default Main; 103 | ``` 104 | 105 | Note that the `getToken({ template: })` call is asynchronous and returns a Promise that needs to be resolved before accessing the token value. This token is short-lived for better security and should be called before every request to your GraphQL API. The caching and refreshing of the token is handled automatically by Clerk. 106 | 107 | ### Next steps 108 | 109 | * Check out our official [Clerk and Hasura with Next.js starter repo](https://github.com/clerkinc/clerk-hasura-starter) 110 | * Replace `fetch` with a GraphQL client like [Apollo](https://github.com/apollographql/apollo-client) or [graphql-request](https://github.com/prisma-labs/graphql-request) 111 | * Try adding some [custom claims](https://docs.clerk.dev/popular-guides/jwt-templates#template-basics) to the JWT token 112 | * Get support or at least say hi in our [Discord channel](https://discord.com/invite/b5rXHjAg7A) 👋 113 | -------------------------------------------------------------------------------- /main-concepts/session-lifetime.md: -------------------------------------------------------------------------------- 1 | # Session Lifetime 2 | 3 | ## Overview 4 | 5 | Depending on the business domain of an application, there might different requirements for how long users should remain signed in. Criteria to base this decision upon, typically revolve around user activity on the application and how long it has been since the user first signed in. 6 | 7 | Ultimately, picking the ideal session lifetime is a trade-off between security and user experience. Longer sessions are generally better for UX but worse for security; and vice-versa. 8 | 9 | Fortunately, with Clerk you have to ability to fully control the lifetime of your users' sessions. There are two settings for doing so and you can set them via your instance settings in the Dashboard: **Inactivity timeout** and **Maximum lifetime**. 10 | 11 | {% hint style="info" %} 12 | Note that anytime either of them or both must be enabled. You are not allowed to disable both of them with respect to security. 13 | {% endhint %} 14 | 15 | ## Inactivity Timeout 16 | 17 | Denotes the duration after which a session will expire and the user will have to sign in again, if they haven't been active on your site. **By default this setting is disabled** for all newly created instances. You can enable it and set your desired value in **Security -> Sessions** section. 18 | 19 | ![](../.gitbook/assets/screely-1639507886785.png) 20 | 21 | ## Maximum lifetime 22 | 23 | Denotes the duration after which a session will expire and the user will have to sign in again, regardless of their activity on your site. **By default this setting is enabled with a default value of 7 days** for all newly created instances. You can find this setting and change the value in **Security -> Sessions**. 24 | 25 | ![](../.gitbook/assets/screely-1639508092338.png) 26 | -------------------------------------------------------------------------------- /main-concepts/sign-in-flow.md: -------------------------------------------------------------------------------- 1 | # Sign in flow 2 | 3 | **Sign in**'s are initiated by creating a **Sign in** object on the current **Client**. The **Sign in** handles all the state and logic associated with a **Sign in**. If the **Sign in** is successfully authenticated, it will transform into an active session, on the current **Client**. 4 | 5 | ## Completing a sign in 6 | 7 | There are 3 main steps a user must perform in order to complete a sign in: 8 | 9 | ### Step 1: Identification 10 | 11 | The first step a user needs to make is to identify what account they'd like to sign in to. This is done with an identifier, which can either be an email address, a phone number, or a username. 12 | 13 | ### Step 2: Factor one verification 14 | 15 | Once a user is identified, they need to prove that "they are who they say they are". This is the process of "authenticating" the user. There's a number of strategies a user can use to perform authentication, the most basic being the humble **password.** Other authentication strategies that Clerk provides, are sending an **email\_code** or **phone\_code.** This will send an email or an SMS message with a code, that the user then must provide in order to sign in. 16 | 17 | ### Step 3: Factor two verification (optional) 18 | 19 | This step only applies to users that have turned on two factor authentication for their user. When one form of verification isn't enough, trust two! But seriously. Forcing two different verification steps _vastly_ increases the security of your account. The most common setup a user will have to protect their account is using a **password** as their first kind of verification, and a **phone\_code** as their second kind of verification. 20 | 21 | ## Verification Strategies 22 | 23 | Now that we've gone over the basic steps of completing a sign in, we'll go over the different types of verification strategies provided, and how to use Clerk's API in each scenario. 24 | 25 | A verification can loosely be separated into two main steps _preparing_ and _attempting_ the verification. Here's a list of each verification strategy, and what steps must be performed: 26 | 27 | * **password** 28 | * Prepare: _no prepare step_. 29 | * Attempt: user supplies the password. 30 | * **email\_code** 31 | * Prepare: sends an email with a code. 32 | * Attempt: user supplies the code. 33 | * **phone\_code** 34 | * Prepare: sends an SMS with a code. 35 | * Attempt: user supplies the code. 36 | * **oauth\_google, oauth\_facebook, oauth\_twitter, etc...** 37 | * Prepare: generates a link the user must visit. 38 | * Attempt: _no attempt step, this happens externally._ 39 | 40 | ## Sign in with OAuth 41 | 42 | There's one more exception we need to talk about. **oauth\_strategies** _do not need to be identified_ since this happens externally by the oauth provider. A sign in can be identified before performing an oauth verification. If this is the case, the identified account must match the one authenticated by the oauth verification. If it doesn't the oauth verification will fail. 43 | 44 | ## User management settings 45 | 46 | Described above are all possible verification and identification strategies. Your API may not have all of these, you can change which strategies are activated through the Clerk Dashboard, in the "Settings > User management " page of your instance. 47 | -------------------------------------------------------------------------------- /main-concepts/sign-up-flow.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: Detailed guide on how the sign up process works 3 | --- 4 | 5 | # Sign up flow 6 | 7 | ## Overview 8 | 9 | Clerk provides a flexible way to build sign up flows in your application. You can use a single **Sign Up** object to gather information, verify their email address or phone number, add OAuth accounts, and finally, convert them into a **User.** 10 | 11 | Every **Sign Up** has a set of requirements it must meet before it is turned into a **User**. **** These requirements are defined by the instance settings you selected in the dashboard. Once all requirements are met, the **Sign Up** will turn into a new **User**, and an active session for that **User** will be created on the current **Client**. 12 | 13 | Don't worry about collecting all the required fields at once and passing them to a single request. The API is designed to accommodate a progressive sign up flow, often corresponding to multi-step sign up forms. 14 | 15 | ## **Required fields** 16 | 17 | The **Sign Up** will show the current state of requirement collection. You can consult the `required_fields`, `optional_fields` and `missing_fields` keys for a hint on where things are and what you need to do next. 18 | 19 | **`required_fields`**: all fields that must be collected before the **Sign Up** converts into a **User**. 20 | 21 | **`optional_fields`**: all fields that can be collected, but are not necessary to convert the **Sign Up**. 22 | 23 | **`missing_fields`**: __ A subset of `required_fields`. It contains all fields that still need to be collected before a successful **Sign Up**. Note that the `missing_fields` will be updated dynamically. As you add more fields to the **Sign Up**, they will be removed from `missing_fields.` Once it's empty, your **Sign Up** will automatically convert into a **User**. 24 | 25 | The values of the collected fields are all accessible on the root of the **Sign Up**, under their corresponding keys; `email_address` and `phone_number` are examples of such keys. 26 | 27 | ## Verified fields 28 | 29 | Some fields, such as `email_address` and `phone_number` , must be verified before it is fully added to the **Sign Up**. Similar to what happens with required fields, the **Sign Up** contains the current state of all verified fields. The keys relative to verification are `unverified_fields` and `verifications`. 30 | 31 | **`unverified_fields`**: a list of all **User** attributes that need to be verified and are pending verification. This is a list that gets updated dynamically, eventually becoming an empty array, when verification for all required fields has been successfully completed. 32 | 33 | **`verifications`**: an object that describes the current state of verification for the **Sign Up**. There are currently three different keys nested in there; `email_address`, `phone_number` and `external_account`. 34 | -------------------------------------------------------------------------------- /popular-guides/build-your-own-ui.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: Use Clerk to build all sorts of authentication flows for your application. 3 | --- 4 | 5 | # Build your own UI 6 | 7 | ## Create a custom sign-up and sign-in page 8 | 9 | Clerk provides [sample code](https://github.com/clerkinc/clerk-nextjs-examples) for different types of authentication flows you might need for your application. Each example is a fully runnable application which you can use either as a starter or a guideline on how you can utilize Clerk based on your requirements. In each example folder, you will find instructions on how to bootstrap the application. 10 | 11 | !["Oasis" and "Acme" examples](../.gitbook/assets/imgonline-com-ua-twotoone-tTWFL7dFHhWMqPDh.jpg) 12 | 13 | !["Widget" and "Simple" examples](../.gitbook/assets/imgonline-com-ua-twotoone-r7j7RPyMYnjWVvLE.jpg) 14 | 15 | ### Available repositories 16 | 17 | * Clerk Next.js examples: [https://github.com/clerkinc/clerk-nextjs-examples](https://github.com/clerkinc/clerk-nextjs-examples) 18 | * Clerk React examples: [https://github.com/clerkinc/clerk-react-examples](https://github.com/clerkinc/clerk-react-examples) 19 | 20 | ### Live Demo 21 | 22 | * Clerk Acme - [https://nextjs.acme.clerk.app/](https://nextjs.acme.clerk.app) 23 | * Clerk Oasis - [https://nextjs.oasis.clerk.app/](https://nextjs.oasis.clerk.app) 24 | * Clerk Widget - [https://nextjs.widget.clerk.app/](https://nextjs.widget.clerk.app) 25 | * Clerk Simple - [https://nextjs.simple.clerk.app/](https://nextjs.simple.clerk.app) 26 | 27 | ## Create a custom user profile page 28 | 29 | Coming soon... 30 | 31 | ## Theming customization 32 | 33 | To provide a seamless experiences for your authentication flows using [Clerk Components](broken-reference), you can provide a variety of theming options through your application [instance dashboard](setup-your-application.md#theme) or at the code level using Clerk [theming customization](../components/customization.md#overview) options. 34 | 35 | -------------------------------------------------------------------------------- /popular-guides/invitations.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: Learn how to invite users to your application 3 | --- 4 | 5 | # Invitations 6 | 7 | ## Overview 8 | 9 | Clerk makes it easy to invite users to your application via the invitations feature. This feature is offered by default to all Clerk applications without any extra configuration. 10 | 11 | All that is needed to do is to create an invitation for an email address. Once the invitation is created, an email with an invitation link will be sent to the user's email address. By clicking on the invitation link, the user will be redirected to the application's sign up page and their email address will have been automatically verified. At this point, the user will just have to fill in the rest of the details according to the [application's settings](setup-your-application.md#user-management). 12 | 13 | Invitations expire after a month. If the user clicks on an expired invitation, they will get redirected to the application's sign up page but they will still have to go via the normal sign up flow, i.e. their email address will not be auto-verified. 14 | 15 | {% hint style="info" %} 16 | Invitations are only used to invite users to your application. The application will still be available to everyone even without an invitation. 17 | 18 | If you're looking into creating invitation-only applications, please refer to our [allowlist feature](../reference/backend-api-reference/allowlist-identifiers.md). 19 | {% endhint %} 20 | 21 | ## Before you start 22 | 23 | * You need to create a Clerk Application in your [Clerk Dashboard](https://dashboard.clerk.dev). For more information, check out our [Setup your application](setup-your-application.md) guide. 24 | 25 | ## Creating invitations 26 | 27 | At the moment, you can only create invitations for email addresses via the Backend API. First, you will need to grab your API key which can be found in Clerk Dashboard under **API Keys** > **Backend API Keys**. 28 | 29 | ![](../.gitbook/assets/screely-1639474987551.png) 30 | 31 | Once you have that, you can make the following request to the Backend API: 32 | 33 | ```bash 34 | curl https://api.clerk.dev/v1/invitations -X POST -d '{"email_address": "email@example.com"}' -H "Authorization:Bearer $YOUR_API_KEY" -H 'Content-Type:application/json' 35 | ``` 36 | 37 | This will create a new invitation and send an invitation email to the given email address. 38 | 39 | ## Revoking invitations 40 | 41 | Revoking an invitation prevents the user from using the invitation link that was sent to them. In order to revoke an invitation, you can make the following request to the Backend API: 42 | 43 | ```bash 44 | curl https://api.clerk.dev/v1/invitations//revoke -X POST -H "Authorization:Bearer $YOUR_API_KEY" -H 'Content-Type:application/json' 45 | ``` 46 | 47 | The invitation id can be found in the response of the invitation creation request. 48 | 49 | {% hint style="warning" %} 50 | Revoking an invitation does **not** prevent the user from signing up on their own. 51 | 52 | If you're looking for invitation-only applications, please refer to our [allowlist feature](../reference/backend-api-reference/allowlist-identifiers.md). 53 | {% endhint %} 54 | 55 | ## Invitation metadata 56 | 57 | Invitations can optionally carry metadata that will eventually end up in the created user once they sign up. The metadata must be a well-formed JSON object. 58 | 59 | In order to add metadata to an invitation, you can use the `public_metadata` property when the invitation is created: 60 | 61 | ``` 62 | curl https://api.clerk.dev/v1/invitations -X POST -d '{"email_address": "email@example.com", "public_metadata": {"user_type": "loyalty"}}' -H "Authorization:Bearer $YOUR_API_KEY" -H 'Content-Type:application/json' 63 | ``` 64 | 65 | Once an invited user signs up using the invitation link, the invitation metadata will end up in the user's `public_metadata`. For more information on a user's metadata, please refer to [Custom User Metadata](../main-concepts/user-object.md#custom-user-metadata). 66 | 67 | ## Custom flow 68 | 69 | If you're using [Clerk Hosted Pages](broken-reference) or [Clerk Components](broken-reference), invitation links are handled out of the box. However, if you have built custom sign up and sign in flows using [ClerkJS](../reference/clerkjs/) directly, then you'll need to do a little bit of extra work. 70 | 71 | The first thing that changes in this case is that during the invitation creation, you will need to specify the url of your sign up page. You can do that by including an additional `redirect_url` parameter in the invitation creation request. 72 | 73 | ```bash 74 | curl https://api.clerk.dev/v1/invitations -X POST -d '{"email_address": "email@example.com", "redirect_url": "https://www.example.com/my-sign-up"}' -H "Authorization:Bearer $YOUR_API_KEY" -H 'Content-Type:application/json' 75 | ``` 76 | 77 | This `redirect_url` basically tells Clerk where to redirect the user when they click on the invitation link. This redirection will include an invitation token, something like the following: 78 | 79 | ```url 80 | https://www.example.com/my-sign-up?__clerk_ticket=..... 81 | ``` 82 | 83 | The second and final thing you'll need to do is to pass this token into the sign up `create` call, when starting the sign up flow. 84 | 85 | {% tabs %} 86 | {% tab title="Clerk React" %} 87 | ```javascript 88 | import { useSignUp } from "@clerk/clerk-react"; 89 | 90 | const signUp = useSignUp(); 91 | 92 | // Get the token from the query parameter 93 | const param = '__clerk_ticket'; 94 | const ticket = new URL(window.location.href).searchParams.get(param); 95 | 96 | // Create a new sign-up with the supplied invitation token. 97 | // Make sure you're also passing the ticket strategy. 98 | // You can also include any additional information required 99 | // based on your application configuration. Or, you can add 100 | // them later using the `signUp.update` method. 101 | // After the below call, the user's email address will be 102 | // verified because of the invitation token. 103 | const response = await signUp.create({ 104 | strategy: "ticket", 105 | ticket, 106 | firstName, 107 | lastName 108 | }); 109 | ``` 110 | {% endtab %} 111 | 112 | {% tab title="ClerkJS" %} 113 | ```javascript 114 | const { client } = window.Clerk; 115 | 116 | // Get the token from the query parameter 117 | const param = '__clerk_invitation_token'; 118 | const ticket = new URL(window.location.href).searchParams.get(param); 119 | 120 | // Create a new sign-up with the supplied invitation ticket. 121 | // Make sure you're also passing the ticket strategy. 122 | // You can also include any additional information required 123 | // based on your application configuration. Or, you can add 124 | // them later using the `signUp.update` method. 125 | // After the below call, the user's email address will be 126 | // verified because of the invitation token. 127 | const signUp = await client.signUp.create({ 128 | strategy: "ticket", 129 | ticket, 130 | firstName, 131 | lastName 132 | }); 133 | ``` 134 | {% endtab %} 135 | {% endtabs %} 136 | -------------------------------------------------------------------------------- /popular-guides/popular-guides-multi-session-applications.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: Learn how to configure and work with multi-session applications 3 | --- 4 | 5 | # Multi-session applications 6 | 7 | ## Overview 8 | 9 | One of the most powerful features that Clerk provides out of the box is multi-session applications. 10 | 11 | A multi-session application is an application that allows multiple accounts to be signed-in from the same browser at the same time. The user can switch from one account to another seamlessly. Each account is independent from the rest and has access to different resources. It's most clearly explained by the default **\** below. 12 | 13 | ![Clerk's User button](<../.gitbook/assets/Screen Shot 2021-07-28 at 11.51.32 PM.png>) 14 | 15 | Note that you can switch which account is active, add additional accounts, and manage each account independently. 16 | 17 | To enable a multi-session instance, you need to handle the following scenarios: 18 | 19 | * Switching between different accounts 20 | * Adding new accounts 21 | * Signing out from one account, while remaining signed in to the rest 22 | 23 | There are two main ways to handle all the above: [using Clerk Components](popular-guides-multi-session-applications.md) or [using a custom flow](popular-guides-multi-session-applications.md#custom-flow). 24 | 25 | {% hint style="info" %} 26 | Looking for more information on session management? Check out our [detailed guide](broken-reference). 27 | {% endhint %} 28 | 29 | ## Before you start 30 | 31 | * You need to create a Clerk Application in your [Clerk Dashboard](https://dashboard.clerk.dev). For more information, check out our [Setup your application](setup-your-application.md) guide. 32 | * You need to install [Clerk React](../reference/clerk-react/) or [ClerkJS](../reference/clerkjs/) to your application. 33 | 34 | ## Configuration 35 | 36 | The first thing you need to do is to enable the multi-session feature in your Clerk instance. 37 | 38 | Go to the [Sessions page](https://dashboard.clerk.dev/last-active?path=sessions) and enable **Multi-session handling**. 39 | 40 | ![](../.gitbook/assets/screely-1639506808306.png) 41 | 42 | That's all you have to do! Now you have a multi-session application! 43 | 44 | ## Using Clerk Components 45 | 46 | The easiest way to add multi-session features to your application is by using the [\](../components/user-button.md) component. 47 | 48 | This component has buttons add a new account, switch between accounts and sign out from one or all accounts. 49 | 50 | {% tabs %} 51 | {% tab title="Clerk React" %} 52 | ```javascript 53 | import { UserButton } from "@clerk/clerk-react"; 54 | 55 | const Header = () => { 56 | return ( 57 |
58 |

My application

59 | 60 |
61 | ); 62 | }; 63 | ``` 64 | {% endtab %} 65 | 66 | {% tab title="ClerkJS" %} 67 | ```markup 68 | 69 | 70 |
71 |

My application

72 |
73 |
74 | 75 | 81 | 82 | 83 | ``` 84 | {% endtab %} 85 | {% endtabs %} 86 | 87 | Note that you don't need to pass any special options to the UserButton component. For more details on all available options, including customization options, please visit the [\ guide](../components/user-button.md). 88 | 89 | ## Custom flow 90 | 91 | In case you want more customization, and you prefer full control over your UI, you can use Clerk's SDKs. 92 | 93 | ### Active session/user 94 | 95 | {% tabs %} 96 | {% tab title="Clerk React" %} 97 | ```javascript 98 | import { useClerk } from "@clerk/clerk-react"; 99 | 100 | // Getting the active session and user 101 | const { session: activeSession, user: activeUser } = useClerk(); 102 | ``` 103 | {% endtab %} 104 | 105 | {% tab title="ClerkJS" %} 106 | ```javascript 107 | // Getting the active session 108 | const activeSession = window.Clerk.session; 109 | 110 | // Getting the active user 111 | const activeUser = window.Clerk.user; 112 | ``` 113 | {% endtab %} 114 | {% endtabs %} 115 | 116 | ### Switching sessions 117 | 118 | {% tabs %} 119 | {% tab title="Clerk React" %} 120 | ```javascript 121 | import { useClerk } from "@clerk/clerk-react"; 122 | 123 | const { client, setSession } = useClerk(); 124 | 125 | // You can retrieve all the available sessions through the client 126 | const availableSessions = client.sessions; 127 | 128 | // Use setSession to set the active session. 129 | setSession(availableSessions[0].id); 130 | ``` 131 | {% endtab %} 132 | 133 | {% tab title="ClerkJS" %} 134 | ```javascript 135 | // You can retrieve all the available sessions through the client 136 | const availableSessions = window.Clerk.client.sessions; 137 | 138 | // Use setSession to set the active session. 139 | window.Clerk.setSession(availableSessions[0].id); 140 | ``` 141 | {% endtab %} 142 | {% endtabs %} 143 | 144 | ### Adding sessions 145 | 146 | To add a new session, simply link to your existing sign in flow. New sign ins will automatically add to the list of available sessions on the client. 147 | 148 | To create a sign in flow, please check one of the following popular guides: 149 | 150 | * [Email and password](email-and-password.md) 151 | * [Passwordless authentication](passwordless-authentication.md) 152 | * [Social login (OAuth)](social-login-oauth.md) 153 | 154 | For more information on how Clerk's sign in flow works, checkout our detailed [sign in guide](../main-concepts/sign-in-flow.md). 155 | 156 | ### Sign out active session 157 | 158 | This version of sign out will deactivate the active session. The rest of the available sessions will remain intact. 159 | 160 | {% tabs %} 161 | {% tab title="Clerk React" %} 162 | ```javascript 163 | import { useClerk } from "@clerk/clerk-react"; 164 | 165 | const { signOutOne } = useClerk(); 166 | 167 | // Use signOutOne to sign-out only from the active session. 168 | await signOutOne(); 169 | ``` 170 | {% endtab %} 171 | 172 | {% tab title="ClerkJS" %} 173 | ```javascript 174 | // Use signOutOne to sign-out only from the active session. 175 | await window.Clerk.signOutOne(); 176 | ``` 177 | {% endtab %} 178 | {% endtabs %} 179 | 180 | ### Sign out of all sessions 181 | 182 | This request will deactivate all sessions on the current client. 183 | 184 | {% tabs %} 185 | {% tab title="Clerk React" %} 186 | ```javascript 187 | import { useClerk } from "@clerk/clerk-react"; 188 | 189 | const { signOut } = useClerk(); 190 | 191 | // Use signOut to sign-out all active sessions. 192 | await signOut(); 193 | ``` 194 | {% endtab %} 195 | 196 | {% tab title="ClerkJS" %} 197 | ```javascript 198 | // Use signOut to sign-out all active sessions. 199 | await window.Clerk.signOut(); 200 | ``` 201 | {% endtab %} 202 | {% endtabs %} 203 | -------------------------------------------------------------------------------- /popular-guides/popular-guides-sign-out.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: Learn how to sign-out users 3 | --- 4 | 5 | # Sign out 6 | 7 | ## Overview 8 | 9 | Once you have a signed in user, you need to give them a way to sign out. 10 | 11 | Please note that the sign out flow only deactivates the current session. Other valid sessions that correspond to the same user (e.g. if the user is signed in on another computer) will continue to work. 12 | 13 | You can either sign out users in Clerk via the [Clerk Components](popular-guides-sign-out.md#using-clerk-components) or build a completely [custom flow](popular-guides-sign-out.md#custom-sign-out) using ClerkJS or Clerk React. 14 | 15 | ## Before you start 16 | 17 | * You need to create a Clerk Application in your [Clerk Dashboard](https://dashboard.clerk.dev). For more information, check out our [Setup your application](setup-your-application.md) guide. 18 | * You need to install [Clerk React](../reference/clerk-react/) or [ClerkJS](../reference/clerkjs/) to your application. 19 | 20 | ## Using Clerk Components 21 | 22 | The simplest way to sign out users is via the [\](../components/user-button.md) component. The user button is a pre-built UI component that gives a signed in user a way to manage their account. One of the options is a **Sign out** button. 23 | 24 | ![Clerk's open User Button.](<../.gitbook/assets/Screen Shot 2021-07-28 at 11.51.32 PM.png>) 25 | 26 | {% tabs %} 27 | {% tab title="Clerk React" %} 28 | ```jsx 29 | import { UserButton } from "@clerk/clerk-react"; 30 | 31 | const Header = () => { 32 | return ( 33 |
34 |

My application

35 | 36 |
37 | ); 38 | }; 39 | ``` 40 | {% endtab %} 41 | 42 | {% tab title="ClerkJS" %} 43 | ```markup 44 | 45 | 46 |
47 |

My application

48 |
49 |
50 | 51 | 57 | 58 | 59 | ``` 60 | {% endtab %} 61 | {% endtabs %} 62 | 63 | Note that you don't need to pass any special options to the \ component. For more details on the available component options as well as how you can customize them, please visit the [UserButton component guide](../components/user-button.md). 64 | 65 | ## Custom sign-out 66 | 67 | In case the pre-built user button doesn't cover your needs and you prefer a custom sign out flow, you can easily make use of our SDKs. 68 | 69 | {% tabs %} 70 | {% tab title="Clerk React" %} 71 | ```jsx 72 | import { useClerk } from "@clerk/clerk-react"; 73 | 74 | const SignOutButton = () => { 75 | const { signOut } = useClerk(); 76 | return ( 77 | 80 | ); 81 | }; 82 | ``` 83 | {% endtab %} 84 | 85 | {% tab title="ClerkJS" %} 86 | ```javascript 87 | // Signs-out the current user. 88 | await window.Clerk.signOut(); 89 | ``` 90 | {% endtab %} 91 | {% endtabs %} 92 | 93 | {% hint style="info" %} 94 | For more information on session management, please check our detailed [Session management](broken-reference) guide. 95 | {% endhint %} 96 | -------------------------------------------------------------------------------- /popular-guides/production-setup.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: Learn how to deploy your app to production. 3 | --- 4 | 5 | # Deploy to production 6 | 7 | ## Overview 8 | 9 | Before you share your app to the world, you'll need to create a production instance. While development instances are convenient, they are not as secure as Clerk's production environment. 10 | 11 | {% hint style="danger" %} 12 | It is strongly recommended that you **do not** go live with a development instance, we are soon going to put up warning messages around this. 13 | {% endhint %} 14 | 15 | {% hint style="info" %} 16 | Deploying on a Clerk provided domain is coming soon. 17 | {% endhint %} 18 | 19 | ## Before you start 20 | 21 | * You should already have your app working with a development instance. 22 | * You will need to be able to add DNS records on your domain. 23 | * You will need Social Login (OAuth) credentials for any providers that you would like to use in production. 24 | 25 | ## Creating your production instance 26 | 27 | ![](../.gitbook/assets/screely-1639506924024.png) 28 | 29 | The modal is relatively straight forward, but there's a few things you should know. Your development and production instances are separate entities, and don't share anything - to match your development instance you should clone it's settings, which we make easy. If you ever need to change a setting, you should do it in development first to make sure everything works, before making the change to your production instance. 30 | 31 | {% hint style="warning" %} 32 | For security reasons, Social Login, Integrations and Paths settings do not copy over, you will need to set these values again. 33 | {% endhint %} 34 | 35 | ## API Keys and Environment variables 36 | 37 | A common mistake when deploying to production is forgetting to change your API keys to your production instances keys. The best way to set this up, is to make use of **Environment variables.** All modern hosting providers, such as AWS, GCP, Vercel, Heroku, Render, etc.. make it easy to add these values. Locally, you should use an `env` file, this way these values are being set dynamically depending on your environment. Here's a list of Clerk variables you'll need to change: 38 | 39 | * Frontend API key 40 | * Formatted `clerk.123.abc.lcl.dev` in development, and `clerk.example.com` in production. and is passed to the **\** during initialization 41 | * Backend API Key 42 | * Formatted `test_xxxxx` in development, and `live_xxxxx` in production. These values are used to access Clerk's Backend API 43 | * OAuth credentials 44 | * In development, Clerk provides you with a set of shared OAuth credentials. These are not secure in production, and you will need to provide your own. 45 | 46 | 47 | 48 | ## DNS Records 49 | 50 | Clerk uses DNS records to provide session management, and emails verified from your domain. You will need to go to **DNS** section to see the records that you need to set. Note: It can take up to 24hrs for DNS Records to fully propagate, so be patient. 51 | 52 | ![](../.gitbook/assets/screely-1639507070957.png) 53 | 54 | {% hint style="danger" %} 55 | Some DNS providers will automatically append the domain for the 'To' field, if this is the case, you will need to omit your domain from the 'To' field. So, add 'clerk' instead of 'clerk.example.com'. 56 | {% endhint %} 57 | 58 | {% hint style="warning" %} 59 | **Do not proxy your records** 60 | 61 | Clerk uses a DNS check to validate this CNAME record. 62 | 63 | If this subdomain is reverse proxied behind a service that points to generic hostnames, such as Cloudflare, the DNS check will fail. Please set the DNS record for this subdomain to a "DNS only" mode on your host to prevent proxying. 64 | {% endhint %} 65 | 66 | ## Deploy 67 | 68 | Once you've completed all the above steps, you're ready to go to the home page, and press **Deploy** to set SSL certificates and finalize the instance deployment. That's all! 69 | 70 | If you run into any trouble feel free to reach out to any of our [support channels](https://clerk.dev/support) and we can help you out. 71 | 72 | ![](../.gitbook/assets/screely-1639507169948.png) 73 | -------------------------------------------------------------------------------- /popular-guides/sync-data-to-your-backend.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: Learn how to sync Clerk data to your application's database 3 | --- 4 | 5 | # Sync data to your backend 6 | 7 | ## Overview 8 | 9 | {% hint style="success" %} 10 | For most use cases, data syncing is not needed at all and this guide can be skipped. 11 | 12 | [ClerkJS](../reference/clerkjs/) provides all the information you might need when using Clerk, including the user id, session id and any other user data needed for presentation on a website. 13 | {% endhint %} 14 | 15 | A common setup for applications involves a frontend and some sort of backend storage system. Since authentication and user management happens on Clerk's side, data eventually need to reach the application's back-end. 16 | 17 | The recommended way to sync data between Clerk and your application's backend is via webhooks. In this guide you'll learn how to enable webhooks and how to setup your back-end so that it is updated every time an event happens on your Clerk instance. 18 | 19 | Given the asynchronous nature of webhooks, they might not fit in every use case out there. If your application requires synchronous updates, refer to our [Synchronous data updates](sync-data-to-your-backend.md#undefined) section. 20 | 21 | ## Before you start 22 | 23 | * You need to create a Clerk Application in your [Clerk Dashboard](https://dashboard.clerk.dev). For more information, check out our [Setup your application](setup-your-application.md) guide. 24 | 25 | ## Webhooks configuration 26 | 27 | Clerk provides webhook support by integrating with [Svix](https://www.svix.com). 28 | 29 | The Svix integration can be enabled on the [Integrations page](https://dashboard.clerk.dev/last-active?path=integrations). Use the toggle button to enable/disable the integration. 30 | 31 | ![](../.gitbook/assets/screely-1639507436297.png) 32 | 33 | Once the Svix integration is enabled, you will need to configure the endpoints of your application which will receive the various Clerk events. You can do that by clicking on **Manage integration** > **Add endpoint**. 34 | 35 | ![](../.gitbook/assets/screely-1639507396704.png) 36 | 37 | You can then enter the actual endpoint URL and choose the Clerk events you want to receive to this endpoint. This endpoint URL should be the endpoint exposed by your back-end which will process the Clerk events. 38 | 39 | ![](../.gitbook/assets/screely-1639507631524.png) 40 | 41 | Once you're ready, click on **Create** to finalize the endpoint setup. 42 | 43 | {% hint style="warning" %} 44 | Selecting no events means that the endpoint will be listening for **all** Clerk events. 45 | {% endhint %} 46 | 47 | ![](../.gitbook/assets/screely-1639507638521.png) 48 | 49 | You can add as many endpoints as it makes sense for your use case and associate each endpoint with as many events you want. For example, you could have a single a single endpoint for all Clerk events you're interested in, or have dedicated endpoints for each group of events or even for each event individually. 50 | 51 | Keep in mind though, that a Clerk event will be sent to all the endpoints it is associated with. So, if you have multiple endpoints associated to the same events, your endpoints will receive duplicate event messages. 52 | 53 | ## Sync data to your backend via webhooks 54 | 55 | For every action the users perform in Clerk via the application's frontend, Clerk will generate a Clerk event which will be sent to the appropriate webhooks that you've already setup. Your backend webhook endpoints will eventually receive the Clerk events and can do the necessary processing. 56 | 57 | A very common pattern is to keep a local copy of your Clerk user information for performance and data consistency purposes. This local copy should **only** be updated by the Clerk events that arrive to the webhook endpoints. 58 | 59 | ![Orchestration of different components during data syncing with webhooks](../.gitbook/assets/sync\_data\_clerk.png) 60 | 61 | An example of the above process can be found in our [Widget example application](https://github.com/clerkinc/clerk-nextjs-examples/tree/main/examples/widget). 62 | 63 | ## Clerk event messages 64 | 65 | At the moment, Clerk will generate events when there is an action that modifies either a user or a session resource. For an extensive list of the Clerk events that can be generated, the payload and how you can verify incoming webhook messages, check our [webhooks reference](../reference/webhooks.md). 66 | 67 | ## Synchronous data updates 68 | 69 | Although webhooks is the preferred way for your backend application to stay up to date with user and session changes, their asynchronous nature might not be ideal for some applications out there. Because of the way they work, your application needs to be designed in a way that handles the [eventual consistency](https://en.wikipedia.org/wiki/Eventual\_consistency) that comes with asynchronous communication. 70 | 71 | If your application requires strong consistency, you can utilize the endpoints of our [Backend API](../reference/backend-api-reference/) to get the latest state of users and sessions. 72 | 73 | In this case, the application's frontend needs to notify the back-end for changes regarding users and sessions. Once the backend is notified, it needs to communicate with Clerk synchronously using the Backend API endpoints to receive the latest state and update the local state accordingly. 74 | 75 | ![Orchestration of different components during data syncing with direct API calls](../.gitbook/assets/sync\_data\_synchronous\_clerk.png) 76 | 77 | {% hint style="danger" %} 78 | Although this pattern provides the ease of synchronous communication, it lacks when it comes to availability and data integrity. There are too many things that could go wrong which would result in the backend storage being out-of-sync with Clerk. 79 | {% endhint %} 80 | -------------------------------------------------------------------------------- /popular-guides/validating-session-tokens.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: A guide to manually validate your session tokens 3 | --- 4 | 5 | # Validating session tokens 6 | 7 | ## Introduction 8 | 9 | When a user is authenticated in your application, a short-lived session token is generated by Clerk.js that depicts the fact and it's sent to your backend. Your backend will typically want to validate that the session token is valid (i.e. that it comes from Clerk, that it hasn't expired etc.) 10 | 11 | If you're using the middlewares provided by our Clerk SDKs, this is all handled automatically in every request. If you're not using the middlewares, you can still use the respective helpers provided by the SDKs to validate the tokens. That is all good, but if an SDK does not exist for application's programming language, you will have to manually validate these tokens. 12 | 13 | This guide provides instructions on how to do exactly that; manually validate the Clerk session tokens that your backend receives. 14 | 15 | ## Overview 16 | 17 | Your Clerk-generated session tokens are essentially JWTs which are signed using your instance's private key and can be verified using your instance's public key. Depending on your architecture, these tokens will be in your backend requests either via a cookie named `__session` or via the `Authorization` header. 18 | 19 | For every request, you must validate its token to make sure it hasn't expired and it is authentic (i.e. no malicious user tried to tamper it). If these validations pass, then it means that the user is authenticated to your application and you should consider them signed in. 20 | 21 | ## Instructions 22 | 23 | By following the steps below, you can validate the session token on your own and make sure that the user session is still active and valid. 24 | 25 | 1. Retrieve the session token from either `__session` cookie or from the `Authorization` header 26 | 2. Get your instance's Public Key. There are 3 ways to do it: 27 | 1. Via the Backend API in JSON Web Key Set (JWKS) format at the following endpoint `https://api.clerk.dev/v1/jwks` 28 | 29 | (If there is more than one JWKS, decode your session token, get the token `kid` from the header part and construct the respective public key) 30 | 2. Via the Frontend API in JSON Web Key Set (JWKS) format at the following endpoint `https:///.well-known/jwks.json` 31 | 32 | (If there is more than one JWKS, decode your session token, get the token `kid` from the header part and construct the respective public key) 33 | 3. If you are planning to use Clerk on a Serverless/Edge Runtime where JWKs caching is challenging, you can use the instance Public Key as an environment variable. The key can be found in `Dashboard > Settings > API Keys > JWT Verification Key`. Note that the JWT Verification key is not in PEM format, the header and footer are missing, in order to be shorter and single-line for easier setup. 34 | 3. Use the above Public Key to verify the token's signature 35 | 4. Validate that the token is not expired, by checking the `exp` and `nbf` claims 36 | 5. If the `azp` claim exists, validate that equals any of your known Origins that are permitted to generate those tokens. This is an extra security check that we are highly recommend to do 37 | 38 | > Steps (3) and (4) should better be done by existing JWT libraries of your favourite language 39 | 40 | If the above process is successful, it means that the user is signed in to your application and you can consider him authenticated. You can also retrieve the session ID and user ID out of the token's claims. 41 | -------------------------------------------------------------------------------- /reference/frontend-api-reference/README.md: -------------------------------------------------------------------------------- 1 | # Frontend API 2 | 3 | -------------------------------------------------------------------------------- /reference/frontend-api-reference/organization-requests/README.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: Manage organizations and memberships with the Frontend API 3 | --- 4 | 5 | # Organization requests 6 | 7 | ## Overview 8 | 9 | Organizations are shared accounts for your application users, so that they can collaborate and share information. 10 | 11 | Users that belong to an organization are called members. Each member has a role, and Clerk supports a role with elevated privileges, which is the organization administrator. 12 | 13 | Organizations requests allow you to create organizations and view information about which organizations your users belong to. 14 | 15 | We've built an organization invitation system that you can trigger from our Frontend API and invite users to become organization members. You can also update members' roles and remove members from an organization. 16 | 17 | ## Requests summary 18 | 19 | ### [Organization requests](organization-requests.md) 20 | 21 | * `POST /v1/organizations` 22 | * `PATCH /v1/organizations/:organization_id` 23 | * `DELETE /v1/organizations/:organization_id` 24 | * `PUT /v1/organizations/:organization_id/logo` 25 | 26 | ### [Organization invitation requests](organization-invitations-requests.md) 27 | 28 | * `POST /v1/organizations/:organization_id/invitations` 29 | * `POST /v1/organizations/:organization_id/invitations/:invitation_id/revoke` 30 | * `GET /v1/organizations/:organization_id/invitations/pending` 31 | 32 | ### [Organization membership requests](organization-membership-requests.md) 33 | 34 | * `POST /v1/organizations/:organization_id/memberships` 35 | * `GET /v1/organizations/:organization_id/memberships` 36 | * `PATCH /v1/organizations/:organization_id/memberships/:user_id` 37 | * `DELETE /v1/organizations/:organization_id/memberships/:user_id` 38 | 39 | -------------------------------------------------------------------------------- /reference/frontend-api-reference/user-api/README.md: -------------------------------------------------------------------------------- 1 | # Client requests 2 | 3 | -------------------------------------------------------------------------------- /reference/frontend-api-reference/user-api/client.md: -------------------------------------------------------------------------------- 1 | # Client 2 | 3 | The **Client** object contains the current state of the **Sign in**, **Sign up**, **and Session(s)** objects. 4 | 5 | ### Available requests 6 | 7 | * **`PUT`**`/v1/client` 8 | * **`GET`**`/v1/client` 9 | * **`DEL`**`/v1/client` 10 | 11 | ### Example client object schema 12 | 13 | ```javascript 14 | { 15 | "object": "client", 16 | "id": "client_1sV3b42PUQh1kX7wi26opkRXR4x", 17 | "sessions": [], 18 | "sign_in_attempt": null, 19 | "sign_up_attempt": null, 20 | "last_active_session_id": null, 21 | "created_at": 1620943997, 22 | "updated_at": 1620943997 23 | } 24 | ``` 25 | 26 | {% swagger baseUrl="https://clerk.example.com" path="/v1/client" method="put" summary="Create or replace the current client" %} 27 | {% swagger-description %} 28 | Replaces the current client object with a new one, if one does not exist it will create one. 29 | 30 | \ 31 | 32 | 33 | 34 | 35 | \ 36 | 37 | 38 | Session Management: This request will replace the existing client cookie. If one does not exist, it will create one. If there are any in-progress actions on the client, such as an active session, the browser will lose access to them 39 | {% endswagger-description %} 40 | 41 | {% swagger-response status="200" description="" %} 42 | ```javascript 43 | { 44 | "response": { 45 | "object": "client", 46 | "id": "client_1sV3b42PUQh1kX7wi26opkRXR4x", 47 | "sessions": [], 48 | "sign_in_attempt": null, 49 | "sign_up_attempt": null, 50 | "last_active_session_id": null, 51 | "created_at": 1620943997, 52 | "updated_at": 1620943997 53 | }, 54 | "client": null 55 | } 56 | ``` 57 | {% endswagger-response %} 58 | {% endswagger %} 59 | 60 | {% swagger baseUrl="https://clerk.example.com" path="/v1/client" method="get" summary="Retrieve the current client" %} 61 | {% swagger-description %} 62 | Retrieve the details of the current client object. 63 | {% endswagger-description %} 64 | 65 | {% swagger-response status="200" description="" %} 66 | ```javascript 67 | { 68 | "response": { 69 | "object": "client", 70 | "id": "client_1sCBzTaRqTlV6sLUtguJPrHQYKf", 71 | "sessions": [ 72 | { 73 | "object": "session", 74 | "id": "sess_1sCBzm5mh3K5DjPmyH4bruWMSi1", 75 | "status": "active", 76 | "expire_at": 1620971755, 77 | "abandon_at": 1622958955, 78 | "last_active_at": 1620366955, 79 | "user": { 80 | "id": "user_1n5AY2RXJyBGhGLAhdEffaOCpFJ", 81 | "object": "user", 82 | "username": null, 83 | "first_name": "Boss", 84 | "last_name": "Clerk", 85 | "gender": "", 86 | "birthday": "", 87 | "profile_image_url": "https://www.gravatar.com/avatar?d=mp", 88 | "primary_email_address_id": "idn_1n5AVtYAHNQY73d6dY6GVJt8gmD", 89 | "primary_phone_number_id": null, 90 | "password_enabled": true, 91 | "two_factor_enabled": false, 92 | "email_addresses": [ 93 | { 94 | "id": "idn_1n5AVtYAHNQY73d6dY6GVJt8gmD", 95 | "object": "email_address", 96 | "email_address": "boss@clerk.dev", 97 | "verification": { 98 | "status": "verified", 99 | "strategy": "email_code", 100 | "attempts": 1, 101 | "expire_at": 1610670206 102 | }, 103 | "linked_to": [] 104 | } 105 | ], 106 | "phone_numbers": [], 107 | "external_accounts": [], 108 | "public_metadata": { 109 | "test": { 110 | "test": "test" 111 | }, 112 | "onboarding": { 113 | "ins_1k5owCRXLwsxnRkzDchVoWTmXI8": { 114 | "oa": 1 115 | } 116 | } 117 | }, 118 | "created_at": 1610669621, 119 | "updated_at": 1619787935 120 | }, 121 | "created_at": 1620366955, 122 | "updated_at": 1620366955 123 | } 124 | ], 125 | "sign_in_attempt": null, 126 | "sign_up_attempt": null, 127 | "last_active_session_id": "sess_1sCBzm5mh3K5DjPmyH4bruWMSi1", 128 | "created_at": 1620366953, 129 | "updated_at": 1620366955 130 | }, 131 | "client": null 132 | } 133 | ``` 134 | {% endswagger-response %} 135 | {% endswagger %} 136 | 137 | {% swagger baseUrl="https://clerk.example.com" path="/v1/client" method="delete" summary="Delete the current client" %} 138 | {% swagger-description %} 139 | Deletes the current client object. This request will also delete the existing client cookie. 140 | 141 | \ 142 | 143 | 144 | 145 | 146 | \ 147 | 148 | 149 | Session management: This request will delete the existing client cookie. 150 | {% endswagger-description %} 151 | 152 | {% swagger-response status="200" description="" %} 153 | ``` 154 | ``` 155 | {% endswagger-response %} 156 | {% endswagger %} 157 | -------------------------------------------------------------------------------- /reference/frontend-api-reference/user-api/introduction.md: -------------------------------------------------------------------------------- 1 | # Overview 2 | 3 | Client requests are responsible for handling the **Sign in**, **Sign up**, and **Session** processes. More specifically, they operate on the **Client** object. A reference to a **Client** object needs to be sent with _every **Frontend API** request_, __ through a Clerk-issued JWT_._ Usually, a "device", such as a browser, or a mobile app, will store one **Client** object to send up with every request. By default, Clerk handles this process, and is explained in the [Session management](broken-reference) section. 4 | 5 | ## Requests summary 6 | 7 | ### [Client requests](broken-reference) 8 | 9 | * **`GET`**`/v1/client` 10 | * **`PUT`**`/v1/client` 11 | * **`DEL`**`/v1/client` 12 | 13 | ### [Sessions requests](sessions.md) 14 | 15 | * **`GET`**` ``/v1/client/sessions/:id` 16 | * **`POST`**`/v1/client/sessions/:id/end` 17 | * **`POST`**`/v1/client/sessions/:id/remove` 18 | 19 | ### [Sign in requests](sign-ins.md) 20 | 21 | #### **Create** 22 | 23 | * **`PUT`**` ``/v1/client/sign_in_attempt` 24 | 25 | #### Identify 26 | 27 | * **`POST`**`/v1/client/sign_in_attempt/identify` 28 | 29 | #### Factor one 30 | 31 | * **`POST`**`/v1/client/sign_in_attempt/prepare_factor_one` 32 | * **`POST`**`/v1/client/sign_in_attempt/attempt_factor_one` 33 | 34 | #### Factor two 35 | 36 | * **`POST`**`/v1/client/sign_in_attempt/prepare_factor_two` 37 | * **`POST`**`/v1/client/sign_in_attempt/attempt_factor_two` 38 | 39 | ### [Sign up requests](sign-ups.md) 40 | 41 | #### **Create/Update** 42 | 43 | * **`PUT`**` ``/v1/client/sessions/sign_up_attempt` 44 | * **`PATCH`**`/v1/client/sessions/sign_up_attempt` 45 | 46 | #### **Email Address** 47 | 48 | * **`PUT`**` ``/v1/client/sign_up_attempt/email_address` 49 | * **`POST`**`/v1/client/sign_up_attempt/email_address/send_verification_email` 50 | * **`POST`**`/v1/client/sign_up_attempt/email_address/verify` 51 | 52 | **Phone Number** 53 | 54 | * **`PUT`**` ``/v1/client/sign_up_attempt/phone_number` 55 | * **`POST`**`/v1/client/sign_up_attempt/phone_number/send_verification_sms` 56 | * **`POST`**`/v1/client/sign_up_attempt/verify` 57 | 58 | **External Account** 59 | 60 | * **`PUT`**`/v1/client/sign_up_attempt/external_accounts` 61 | -------------------------------------------------------------------------------- /reference/frontend-api-reference/user-api/sessions.md: -------------------------------------------------------------------------------- 1 | # Sessions 2 | 3 | A **Session** object represents an active session for a user. Sessions are created when a user successfully goes through the sign in or sign up flows. 4 | 5 | ### Available requests 6 | 7 | * **`GET`**` ``/v1/client/sessions/:id` 8 | * **`POST`**`/v1/client/sessions/:id/tokens` 9 | * **`POST`**`/v1/client/sessions/:id/touch` 10 | * **`POST`**`/v1/client/sessions/:id/end` 11 | * **`POST`**`/v1/client/sessions/:id/remove` 12 | 13 | ## The Session object 14 | 15 | ```javascript 16 | { 17 | "object": "session", 18 | "id": "sess_1q8uCbeJSMgTJnTQMgpAK1Ff0ER", 19 | "client_id": "client_1q8sn8pLHjqTU2g1UheJwJ7YWU6", 20 | "user_id": "user_1n5BS00ns3t21GWIXiPJ0KcSe02", 21 | "status": "active", 22 | "last_active_at": 1616473411, 23 | "expire_at": 1617078211, 24 | "abandon_at": 1619065411 25 | } 26 | ``` 27 | 28 | {% swagger baseUrl="https://clerk.example.com" path="/v1/client/sessions/:id" method="get" summary="Retrieve a session" %} 29 | {% swagger-description %} 30 | Retrieve the details of a session. 31 | {% endswagger-description %} 32 | 33 | {% swagger-parameter in="path" name="id" type="String" required="true" %} 34 | The ID of the session 35 | {% endswagger-parameter %} 36 | 37 | {% swagger-response status="200" description="" %} 38 | ``` 39 | // see example schema 40 | { 41 | "object": "session", 42 | "id": "sess_1q8uCbeJSMgTJnTQMgpAK1Ff0ER", 43 | ... 44 | } 45 | ``` 46 | {% endswagger-response %} 47 | {% endswagger %} 48 | 49 | {% swagger method="post" path="/v1/client/sessions/:id/tokens" baseUrl="https://clerk.example.com" summary="Issue a session JWT" %} 50 | {% swagger-description %} 51 | Issue a new session JWT for authentication 52 | {% endswagger-description %} 53 | 54 | {% swagger-parameter in="path" required="true" name="id" type="String" %} 55 | The ID of the session. 56 | {% endswagger-parameter %} 57 | 58 | {% swagger-response status="200: OK" description="" %} 59 | ```javascript 60 | { 61 | jwt: "" 62 | object: "token" 63 | } 64 | ``` 65 | {% endswagger-response %} 66 | {% endswagger %} 67 | 68 | {% swagger method="post" path="/v1/client/sessions/:id/touch" baseUrl="https://clerk.example.com" summary="Touch current session" %} 69 | {% swagger-description %} 70 | This endpoint marks the session as the last used session 71 | {% endswagger-description %} 72 | 73 | {% swagger-parameter in="path" required="true" type="String" name="id" %} 74 | The ID of the session. 75 | {% endswagger-parameter %} 76 | 77 | {% swagger-response status="200: OK" description="" %} 78 | ```javascript 79 | { 80 | // Response 81 | } 82 | ``` 83 | {% endswagger-response %} 84 | {% endswagger %} 85 | 86 | {% swagger baseUrl="https://clerk.example.com" path="/v1/client/sessions/:id/end" method="post" summary="End a session" %} 87 | {% swagger-description %} 88 | Ends a currently active Session. Synonymous with "signing out" the user. The session will still be present on the client object. 89 | {% endswagger-description %} 90 | 91 | {% swagger-parameter in="path" name="id" required="true" %} 92 | The ID of the session. 93 | {% endswagger-parameter %} 94 | 95 | {% swagger-response status="200" description="" %} 96 | ``` 97 | // see example schema 98 | [ 99 | { 100 | "object": "session", 101 | "id": "sess_1q8uCbeJSMgTJnTQMgpAK1Ff0ER", 102 | ... 103 | }, 104 | { 105 | "object": "session", 106 | "id": "sess_1q8uCbeJSMgTJnTQMgpAK1Ff0ER", 107 | ... 108 | } 109 | ] 110 | ``` 111 | {% endswagger-response %} 112 | {% endswagger %} 113 | 114 | {% swagger baseUrl="https://clerk.example.com" path="/v1/client/sessions/:id/remove" method="post" summary="Remove a session" %} 115 | {% swagger-description %} 116 | Completely removes the session from client. 117 | {% endswagger-description %} 118 | 119 | {% swagger-parameter in="path" name="id" type="String" required="true" %} 120 | The ID of the session. 121 | {% endswagger-parameter %} 122 | 123 | {% swagger-response status="200" description="" %} 124 | ``` 125 | // see example schema 126 | { 127 | "object": "session", 128 | "id": "sess_1q8uCbeJSMgTJnTQMgpAK1Ff0ER", 129 | ... 130 | } 131 | ``` 132 | {% endswagger-response %} 133 | {% endswagger %} 134 | -------------------------------------------------------------------------------- /reference/frontend-api-reference/users/README.md: -------------------------------------------------------------------------------- 1 | # User requests 2 | 3 | -------------------------------------------------------------------------------- /reference/frontend-api-reference/users/email-addresses.md: -------------------------------------------------------------------------------- 1 | # Email addresses 2 | 3 | ## Available requests 4 | 5 | * **`GET`**` ``/v1/me/email_addresses` 6 | * **`POST`**`/v1/me/email_addresses` 7 | * **`GET`**` ``/v1/me/email_addresses/:id` 8 | * **`POST`**`/v1/me/email_addresses/:id/send_verification_email` 9 | * **`POST`**`/v1/me/email_addresses/:id/verify` 10 | * **`DEL`**` ``/v1/me/email_addresses/:id` 11 | 12 | ## The email address object 13 | 14 | ```javascript 15 | { 16 | "id": "idn_1o4qfak5AdI2qlXSXENGL05iei6", 17 | "object": "email_address", 18 | "email_address": "boss@clerk.dev", 19 | "verification": { 20 | "status": "verified", 21 | "strategy": "from_oauth_google" 22 | }, 23 | "linked_to": [ 24 | { 25 | "type": "oauth_google", 26 | "id": "idn_1o4qfbU8YjpJgfpDza4U4aTbClb" 27 | } 28 | ] 29 | } 30 | ``` 31 | 32 | {% swagger baseUrl="https://clerk.example.com" path="/v1/me/email_addresses" method="get" summary="List all email addresses" %} 33 | {% swagger-description %} 34 | Returns a list of the current user's email addresses. 35 | {% endswagger-description %} 36 | 37 | {% swagger-response status="200" description="" %} 38 | ```javascript 39 | // see the email address object above. 40 | [ 41 | { 42 | "id": "idn_1o4qfak5AdI2qlXSXENGL05iei6", 43 | "object": "email_address", 44 | ... 45 | }, 46 | ... 47 | ] 48 | ``` 49 | {% endswagger-response %} 50 | {% endswagger %} 51 | 52 | {% swagger baseUrl="https://clerk.example.com" path="/v1/me/email_addresses/:id" method="get" summary="Retrieve an email address" %} 53 | {% swagger-description %} 54 | Returns the current user's email address with the given ID. 55 | {% endswagger-description %} 56 | 57 | {% swagger-parameter in="path" name="id" type="string" %} 58 | ID of the email address. 59 | {% endswagger-parameter %} 60 | 61 | {% swagger-response status="200" description="" %} 62 | ```javascript 63 | // see the email address object above. 64 | { 65 | "id": "idn_1o4qfak5AdI2qlXSXENGL05iei6", 66 | "object": "email_address", 67 | ... 68 | } 69 | ``` 70 | {% endswagger-response %} 71 | {% endswagger %} 72 | 73 | {% swagger baseUrl="https://clerk.example.com" path="/v1/me/email_addresses" method="post" summary="Create an email address" %} 74 | {% swagger-description %} 75 | Create an email address for the current user. This email address will need to be verified before it is active on the user. 76 | {% endswagger-description %} 77 | 78 | {% swagger-parameter in="body" name="email_address" type="string" %} 79 | The email address that you are adding to the current user. 80 | {% endswagger-parameter %} 81 | 82 | {% swagger-response status="200" description="" %} 83 | ```javascript 84 | // see the email address object above. 85 | { 86 | "id": "idn_1o4qfak5AdI2qlXSXENGL05iei6", 87 | "object": "email_address", 88 | ... 89 | } 90 | ``` 91 | {% endswagger-response %} 92 | {% endswagger %} 93 | 94 | {% swagger baseUrl="https://clerk.example.com" path="/v1/me/email_addresses/:id/send_verification_email" method="post" summary="Send a verification email" %} 95 | {% swagger-description %} 96 | Send a verification email to the email address with the given ID. Can only send to email addresses that have not been verified. 97 | {% endswagger-description %} 98 | 99 | {% swagger-parameter in="path" name="id" type="string" %} 100 | ID of the email address. 101 | {% endswagger-parameter %} 102 | 103 | {% swagger-response status="200" description="" %} 104 | ```javascript 105 | // see the email address object above. 106 | { 107 | "id": "idn_1o4qfak5AdI2qlXSXENGL05iei6", 108 | "object": "email_address", 109 | ... 110 | } 111 | ``` 112 | {% endswagger-response %} 113 | {% endswagger %} 114 | 115 | {% swagger baseUrl="https://clerk.example.com" path="/v1/me/email_addresses/:id/verify" method="post" summary="Verify an email address" %} 116 | {% swagger-description %} 117 | Verify the current user's email address. 118 | {% endswagger-description %} 119 | 120 | {% swagger-parameter in="path" name="id" type="string" %} 121 | ID of the email address. 122 | {% endswagger-parameter %} 123 | 124 | {% swagger-parameter in="body" name="code" type="string" %} 125 | The 6 digit code that was sent via email. You only get 3 chances to correctly verify, before a new code must be generated. 126 | {% endswagger-parameter %} 127 | 128 | {% swagger-response status="200" description="" %} 129 | ```javascript 130 | // see the email address object above. 131 | { 132 | "id": "idn_1o4qfak5AdI2qlXSXENGL05iei6", 133 | "object": "email_address", 134 | ... 135 | } 136 | ``` 137 | {% endswagger-response %} 138 | {% endswagger %} 139 | 140 | {% swagger baseUrl="https://clerk.example.com" path="/v1/me/email_addresses/:id" method="delete" summary="Delete an email address" %} 141 | {% swagger-description %} 142 | Delete the current user's email address. 143 | {% endswagger-description %} 144 | 145 | {% swagger-parameter in="path" name="id" type="string" %} 146 | ID of the email address. 147 | {% endswagger-parameter %} 148 | 149 | {% swagger-response status="200" description="" %} 150 | ```javascript 151 | { 152 | "id": "idn_1wKRXU2bsrzOxiVPJnUK2d757ex", 153 | "object": "email_address", 154 | "deleted": true 155 | } 156 | ``` 157 | {% endswagger-response %} 158 | {% endswagger %} 159 | -------------------------------------------------------------------------------- /reference/frontend-api-reference/users/introduction.md: -------------------------------------------------------------------------------- 1 | # Overview 2 | 3 | User requests are responsible for handling any actions on the current user, and you must be signed in as that **User**. A reference to a **Client** object needs to be sent with __ each __ request, __ through a Clerk-issued JWT_._ This step is handled automatically if you're using one Clerk's Session Management. 4 | 5 | ## Requests summary 6 | 7 | ### [Current user requests](user.md) 8 | 9 | * **`GET`**` ``/v1/me` 10 | * **`PATCH`**`/v1/me` 11 | 12 | ### [Email addresses requests](email-addresses.md) 13 | 14 | * **`GET`**` ``/v1/me/email_addresses` 15 | * **`POST`**`/v1/me/email_addresses` 16 | * **`GET`**` ``/v1/me/email_addresses/:id` 17 | * **`POST`**`/v1/me/email_addresses/:id/send_verification_email` 18 | * **`POST`**`/v1/me/email_addresses/:id/verify` 19 | * **`DEL`**` ``/v1/me/email_addresses/:id` 20 | 21 | ### [Phone numbers requests](phone-numbers.md) 22 | 23 | * **`GET`**` ``/v1/me/phone_numbers` 24 | * **`POST`**` ``/v1/me/phone_numbers` 25 | * **`GET`**` ``/v1/me/phone_numbers/:id` 26 | * **`PATCH`**`/v1/me/phone_numbers/:id` 27 | * **`POST`**` ``/v1/me/phone_numbers/:id/send_verification_sms` 28 | * **`POST`**` ``/v1/me/phone_numbers/:id/verify` 29 | * **`DEL`**` ``/v1/me/sessions/:id` 30 | 31 | ### [Profile image requests](profile-image.md) 32 | 33 | * **`POST`**`/v1/me/profile_image` 34 | 35 | ### [Sessions requests](sessions.md) 36 | 37 | * **`GET`**` ``/v1/me/sessions` 38 | * **`GET`**` ``/v1/me/sessions/active` 39 | * **`POST`**`/v1/me/sessions/:id/revoke` 40 | 41 | ### [Tokens requests](tokens.md) 42 | 43 | * **`POST`**`/v1/me/tokens` 44 | 45 | ### [Organization requests](organizations-1.md) 46 | 47 | * **`GET`**`/v1/me/organizations` 48 | 49 | ### [TOTP requests](organizations-2.md) 50 | 51 | * **`POST`**`/v1/me/totp` 52 | * **`POST`**`/v1/me/totp/attempt_verification` 53 | * **`DEL`**`/v1/me/totp` 54 | 55 | ### [Backup codes requests](organizations.md) 56 | 57 | * **`POST`**`/v1/me/backup_codes` 58 | 59 | -------------------------------------------------------------------------------- /reference/frontend-api-reference/users/organizations-1.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: Retrieve information regarding the organizations the user is a member of. 3 | --- 4 | 5 | # Organizations 6 | 7 | {% hint style="info" %} 8 | Organizations is a premium feature. Please get in touch if you would like us to enable it for your account. You can contact us at [support@clerk.dev](mailto:support@clerk.dev). 9 | {% endhint %} 10 | 11 | ## Available requests 12 | 13 | * **`GET`**`/v1/me/organizations` 14 | 15 | ## The organization object 16 | 17 | ```json 18 | { 19 | "object": "organization", 20 | "id": "org_21Ufcy98STcA11s3QckIwtwHIES", 21 | "logo_url": "https://images.clerk.services/default-logo.png", 22 | "name": "Acme Inc", 23 | "public_metadata": {}, 24 | "slug": "acme-inc", 25 | "role": "basic_member", 26 | "created_at": 1438000669544, 27 | "updated_at": 1438000669544 28 | } 29 | ``` 30 | 31 | {% swagger baseUrl="https://clerk.example.com" path="/v1/me/organizations" method="get" summary="List organizations" %} 32 | {% swagger-description %} 33 | Returns a list of the organizations that the current user is a member of. 34 | 35 | The organization membership role is included. 36 | 37 | The organizations will be ordered by descending membership creation date, which means that the organization that the user joined most recently will be first in the list. 38 | 39 | Results can be paginated by supplying a combination of `limit` and `offset` query parameters. 40 | {% endswagger-description %} 41 | 42 | {% swagger-parameter in="query" name="limit" type="Number" %} 43 | Applies a limit to the number of organizations returned. Can be used for paginating the results together with 44 | 45 | `offset` 46 | 47 | . Must be an integer greater than zero. 48 | {% endswagger-parameter %} 49 | 50 | {% swagger-parameter in="query" name="offset" type="Number" %} 51 | Skip the first 52 | 53 | `offset` 54 | 55 | results when paginating. Needs to be an integer greater than zero. Use it together with 56 | 57 | `limit` 58 | 59 | to skip the last retrieved organizations. 60 | {% endswagger-parameter %} 61 | 62 | {% swagger-response status="200" description="Organization list retrieved successfully." %} 63 | ```javascript 64 | [ 65 | { 66 | "object": "organization", 67 | "id": "org_1o4qfak5AdI2qlXSXENGL05iei6", 68 | "logo_url": "https://images.clerk.services/default-logo.png", 69 | "name": "Acme Inc", 70 | "public_metadata": {}, 71 | "role": "basic_member", 72 | "slug": "acme-inc", 73 | "created_at": 1638000669544, 74 | "updated_at": 1638000669544 75 | }, 76 | { 77 | "object": "organization", 78 | "id": "org_1o4qfak5AdI2qlXSXENGL05iei6", 79 | "logo_url": null, 80 | "name": "Foozbaz", 81 | "public_metadata": {}, 82 | "role": "admin", 83 | "slug": "foozbaz", 84 | "created_at": 1612556316784, 85 | "updated_at": 1612556316784 86 | } 87 | ] 88 | ``` 89 | {% endswagger-response %} 90 | 91 | {% swagger-response status="403: Forbidden" description="Insufficient permissions to list organizations." %} 92 | ```javascript 93 | { 94 | "errors": [ 95 | { 96 | "code": "organizations_not_enabled_in_instance", 97 | "long_message": "The organizations feature is not enabled for your instance. If you want to try it out, contact us at support@clerk.dev.", 98 | "message": "access denied" 99 | } 100 | ] 101 | } 102 | ``` 103 | {% endswagger-response %} 104 | {% endswagger %} 105 | -------------------------------------------------------------------------------- /reference/frontend-api-reference/users/organizations-2.md: -------------------------------------------------------------------------------- 1 | # TOTP 2 | 3 | {% hint style="info" %} 4 | TOTP (Authenticator App) is a premium feature. Please get in touch if you would like us to enable it for your account. You can contact us at [support@clerk.dev](mailto:support@clerk.dev). 5 | {% endhint %} 6 | 7 | ## Available requests 8 | 9 | * **`POST`**`/v1/me/totp` 10 | * **`POST`**`/v1/me/totp/attempt_verification` 11 | * **`DEL`**`/v1/me/totp` 12 | 13 | ## The TOTP object 14 | 15 | ```json 16 | { 17 | "object": "totp", 18 | "id": "totp_21Ufcy98STcA11s3QckIwtwHIES", 19 | "secret": "6JHMXLT5H3WOF5PSHX7ALXXFX7NLTRBJ", 20 | "uri": "otpauth://totp/docs:docs@email.com?algorithm=SHA1&digits=6&issuer=docs&period=30&secret=6JHMXLT5H3WOF5PSHX7ALXXFX7NLTRBJ", 21 | "verified": true, 22 | "backup_codes": ["12345678", "abcdefgh"], 23 | "created_at": 1438000669544, 24 | "updated_at": 1438000669544 25 | } 26 | ``` 27 | 28 | {% swagger baseUrl="https://clerk.example.com" path="/v1/me/totp" method="post" summary="Creates a new TOTP object" %} 29 | {% swagger-description %} 30 | Creates a new unverified TOTP object that seeks verification before it is enabled 31 | {% endswagger-description %} 32 | 33 | {% swagger-response status="200" description="TOTP created successfully." %} 34 | 35 | {% endswagger-response %} 36 | 37 | {% swagger-response status="400: Bad Request" description="TOTP already enabled." %} 38 | ```javascript 39 | { 40 | // Response 41 | } 42 | ``` 43 | {% endswagger-response %} 44 | 45 | {% swagger-response status="403: Forbidden" description="Insufficient permissions." %} 46 | 47 | {% endswagger-response %} 48 | {% endswagger %} 49 | 50 | {% swagger method="post" path="/v1/me/totp/attempt_verification" baseUrl="https://clerk.example.com" summary="Attempt verification of the TOTP" %} 51 | {% swagger-description %} 52 | Attempts to verify the existing TOTP, by providing a valid code. If the operation is successful, TOTP is been enabled for the user. 53 | {% endswagger-description %} 54 | 55 | {% swagger-response status="200: OK" description="TOTP successfully verified and enabled." %} 56 | ```javascript 57 | { 58 | // Response 59 | } 60 | ``` 61 | {% endswagger-response %} 62 | 63 | {% swagger-response status="400: Bad Request" description="TOTP already enabled." %} 64 | ```javascript 65 | { 66 | // Response 67 | } 68 | ``` 69 | {% endswagger-response %} 70 | 71 | {% swagger-response status="404: Not Found" description="TOTP not found." %} 72 | ```javascript 73 | { 74 | // Response 75 | } 76 | ``` 77 | {% endswagger-response %} 78 | 79 | {% swagger-response status="422: Unprocessable Entity" description="The provided code is invalid." %} 80 | ```javascript 81 | { 82 | // Response 83 | } 84 | ``` 85 | {% endswagger-response %} 86 | 87 | {% swagger-response status="403: Forbidden" description="Insufficient permissions." %} 88 | ```javascript 89 | { 90 | // Response 91 | } 92 | ``` 93 | {% endswagger-response %} 94 | {% endswagger %} 95 | 96 | {% swagger method="delete" path="/v1/me/totp" baseUrl="https://clerk.example.com" summary="Delete TOTP" %} 97 | {% swagger-description %} 98 | Deletes and disables the TOTP of the user. 99 | {% endswagger-description %} 100 | 101 | {% swagger-response status="200: OK" description="TOTP deleted successfully." %} 102 | ```javascript 103 | { 104 | // Response 105 | } 106 | ``` 107 | {% endswagger-response %} 108 | 109 | {% swagger-response status="404: Not Found" description="TOTP not enabled." %} 110 | ```javascript 111 | { 112 | // Response 113 | } 114 | ``` 115 | {% endswagger-response %} 116 | 117 | {% swagger-response status="403: Forbidden" description="Insufficient permissions." %} 118 | ```javascript 119 | { 120 | // Response 121 | } 122 | ``` 123 | {% endswagger-response %} 124 | {% endswagger %} 125 | -------------------------------------------------------------------------------- /reference/frontend-api-reference/users/organizations.md: -------------------------------------------------------------------------------- 1 | # Backup codes 2 | 3 | {% hint style="info" %} 4 | Backup codes is a premium feature. Please get in touch if you would like us to enable it for your account. You can contact us at [support@clerk.dev](mailto:support@clerk.dev). 5 | {% endhint %} 6 | 7 | ## Available requests 8 | 9 | * **`POST`**`/v1/me/backup codes` 10 | 11 | ## The Backup Code object 12 | 13 | ```json 14 | { 15 | "object": "backup_code", 16 | "id": "bcode_21Ufcy98STcA11s3QckIwtwHIES", 17 | "codes": ["12345678", "abcdefgh"], 18 | "created_at": 1438000669544, 19 | "updated_at": 1438000669544 20 | } 21 | ``` 22 | 23 | {% swagger baseUrl="https://clerk.example.com" path="/v1/me/backup_codes" method="post" summary="Create backup codes" %} 24 | {% swagger-description %} 25 | Generates a fresh new set of backup codes for the user. 26 | {% endswagger-description %} 27 | 28 | {% swagger-response status="200" description="Creates a new set successfully." %} 29 | 30 | {% endswagger-response %} 31 | 32 | {% swagger-response status="403: Forbidden" description="Insufficient permissions" %} 33 | 34 | {% endswagger-response %} 35 | {% endswagger %} 36 | -------------------------------------------------------------------------------- /reference/frontend-api-reference/users/phone-numbers.md: -------------------------------------------------------------------------------- 1 | # Phone numbers 2 | 3 | ## Available requests 4 | 5 | * **`GET`**` ``/v1/me/phone_numbers` 6 | * **`POST`**` ``/v1/me/phone_numbers` 7 | * **`GET`**` ``/v1/me/phone_numbers/:id` 8 | * **`PATCH`**`/v1/me/phone_numbers/:id` 9 | * **`POST`**` ``/v1/me/phone_numbers/:id/send_verification_sms` 10 | * **`POST`**` ``/v1/me/phone_numbers/:id/verify` 11 | * **`DEL`**` ``/v1/me/phone_numbers/:id` 12 | 13 | ## The phone number object 14 | 15 | ```javascript 16 | { 17 | "id": "idn_1o4qfak5AdI2qlXSXENGL05iei6", 18 | "object": "phone_number", 19 | "email_address": "+12015555555", 20 | "verification": { 21 | "status": "verified", 22 | "strategy": "phone_code" 23 | }, 24 | "linked_to": [] 25 | } 26 | ``` 27 | 28 | {% swagger baseUrl="https://clerk.example.com" path="/v1/me/phone_numbers" method="get" summary="List all phone numbers" %} 29 | {% swagger-description %} 30 | Returns a list of the current user's phone numbers. 31 | {% endswagger-description %} 32 | 33 | {% swagger-response status="200" description="" %} 34 | ```javascript 35 | // see the phone number object above. 36 | [ 37 | { 38 | "id": "idn_1o4qfak5AdI2qlXSXENGL05iei6", 39 | "object": "phone_number", 40 | ... 41 | }, 42 | ... 43 | ] 44 | ``` 45 | {% endswagger-response %} 46 | {% endswagger %} 47 | 48 | {% swagger baseUrl="https://clerk.example.com" path="/v1/me/phone_numbers/:id" method="get" summary="Retrieve a phone number" %} 49 | {% swagger-description %} 50 | Returns the current user's phone number with the given ID. 51 | {% endswagger-description %} 52 | 53 | {% swagger-parameter in="path" name="id" type="string" %} 54 | ID of the phone number. 55 | {% endswagger-parameter %} 56 | 57 | {% swagger-response status="200" description="" %} 58 | ```javascript 59 | // see the phone number object above. 60 | { 61 | "id": "idn_1o4qfak5AdI2qlXSXENGL05iei6", 62 | "object": "phone_number", 63 | ... 64 | } 65 | ``` 66 | {% endswagger-response %} 67 | {% endswagger %} 68 | 69 | {% swagger baseUrl="https://clerk.example.com" path="/v1/me/phone_numbers" method="post" summary="Create a phone number" %} 70 | {% swagger-description %} 71 | Create a new phone number for the current user. 72 | {% endswagger-description %} 73 | 74 | {% swagger-parameter in="body" name="phone_number" type="string" %} 75 | The phone number that you are adding to the current user. 76 | {% endswagger-parameter %} 77 | 78 | {% swagger-response status="200" description="" %} 79 | ```javascript 80 | // see the phone number object above. 81 | { 82 | "id": "idn_1o4qfak5AdI2qlXSXENGL05iei6", 83 | "object": "phone_number", 84 | ... 85 | } 86 | ``` 87 | {% endswagger-response %} 88 | {% endswagger %} 89 | 90 | {% swagger baseUrl="https://clerk.example.com" path="/v1/me/phone_numbers/:id/send_verification_sms" method="post" summary="Send a verification SMS" %} 91 | {% swagger-description %} 92 | Send a verification SMS to the phone number with the given ID. Only valid for unverified phone numbers. 93 | {% endswagger-description %} 94 | 95 | {% swagger-parameter in="path" name="id" type="string" %} 96 | ID of the phone number. 97 | {% endswagger-parameter %} 98 | 99 | {% swagger-response status="200" description="" %} 100 | ```javascript 101 | // see the phone number object above. 102 | { 103 | "id": "idn_1o4qfak5AdI2qlXSXENGL05iei6", 104 | "object": "phone_number", 105 | ... 106 | } 107 | ``` 108 | {% endswagger-response %} 109 | {% endswagger %} 110 | 111 | {% swagger baseUrl="https://clerk.example.com" path="/v1/me/phone_numbers/:id/verify" method="post" summary="Verify a phone number" %} 112 | {% swagger-description %} 113 | Verify a phone number with the given ID. 114 | {% endswagger-description %} 115 | 116 | {% swagger-parameter in="path" name="id" type="string" %} 117 | ID of the phone number. 118 | {% endswagger-parameter %} 119 | 120 | {% swagger-parameter in="body" name="code" type="string" %} 121 | The 6 digit code that was sent via SMS. You only get 3 chances to correctly verify, before a new code must be generated. 122 | {% endswagger-parameter %} 123 | 124 | {% swagger-response status="200" description="" %} 125 | ```javascript 126 | // see the phone number object above. 127 | { 128 | "id": "idn_1o4qfak5AdI2qlXSXENGL05iei6", 129 | "object": "phone_number", 130 | ... 131 | } 132 | ``` 133 | {% endswagger-response %} 134 | {% endswagger %} 135 | 136 | {% swagger baseUrl="https://clerk.example.com" path="/v1/me/phone_number/:id" method="patch" summary="Update a phone number" %} 137 | {% swagger-description %} 138 | Update the specified phone number. Currently all you can do is turn on or off MFA using this phone number. 139 | {% endswagger-description %} 140 | 141 | {% swagger-parameter in="path" name="id" type="string" %} 142 | ID of the phone number. 143 | {% endswagger-parameter %} 144 | 145 | {% swagger-parameter in="body" name="reserverd_for_second_factor" type="boolean" %} 146 | Turn on MFA with the specified phone number. If set to true, sign in will require a second step. 147 | {% endswagger-parameter %} 148 | 149 | {% swagger-response status="200" description="" %} 150 | ```javascript 151 | // see the phone number object above. 152 | { 153 | "id": "idn_1o4qfak5AdI2qlXSXENGL05iei6", 154 | "object": "phone_number", 155 | ... 156 | } 157 | ``` 158 | {% endswagger-response %} 159 | {% endswagger %} 160 | 161 | {% swagger baseUrl="https://clerk.example.com" path="/v1/me/phone_number/:id" method="delete" summary="Delete a phone number" %} 162 | {% swagger-description %} 163 | Delete the current user's phone number. 164 | {% endswagger-description %} 165 | 166 | {% swagger-parameter in="path" name="id" type="string" %} 167 | ID of the phone number. 168 | {% endswagger-parameter %} 169 | 170 | {% swagger-response status="200" description="" %} 171 | ```javascript 172 | // see the phone number object above. 173 | { 174 | "id": "idn_1o4qfak5AdI2qlXSXENGL05iei6", 175 | "object": "phone_number", 176 | ... 177 | } 178 | ``` 179 | {% endswagger-response %} 180 | {% endswagger %} 181 | -------------------------------------------------------------------------------- /reference/frontend-api-reference/users/profile-image.md: -------------------------------------------------------------------------------- 1 | # Profile image 2 | 3 | ## Available requests 4 | 5 | * **`POST`**`/v1/me/profile_image` 6 | * **`DELETE`**` ``/v1/me/profile_image` 7 | 8 | ## The image object 9 | 10 | ```javascript 11 | { 12 | "object": "image", 13 | "id": "img_1wL1cVE503unGZ05yyG5hZX7xdJ", 14 | "name": "img.jpeg", 15 | "public_url": "https://images.clerk.dev/uploaded/img_1wL1cVE503unGZ05yyG5hZX7xdJ.jpeg" 16 | } 17 | ``` 18 | 19 | {% swagger baseUrl="https://clerk.example.com" path="/v1/me/profile_image" method="post" summary="Update profile image" %} 20 | {% swagger-description %} 21 | Upload a new profile image for the current user. Must use multipart/form-data with one image file. It must be a jpg, png, gif, or webp image smaller than 10 MB. 22 | {% endswagger-description %} 23 | 24 | {% swagger-parameter in="body" name="file" type="object" %} 25 | The image to upload. 26 | {% endswagger-parameter %} 27 | 28 | {% swagger-response status="200" description="" %} 29 | ``` 30 | ``` 31 | {% endswagger-response %} 32 | {% endswagger %} 33 | 34 | {% swagger method="delete" path="/v1/me/profile_image" baseUrl="https://api.clerk.dev" summary="Delete profile image" %} 35 | {% swagger-description %} 36 | Remove a user's profile image. 37 | {% endswagger-description %} 38 | 39 | {% swagger-response status="200: OK" description="The user profile image was successfully deleted." %} 40 | ```javascript 41 | { 42 | "object": "image", 43 | "id": "img_21Ufcy98STcA11s3QckIwtwHIES", 44 | "slug": "", 45 | "deleted": true 46 | } 47 | ``` 48 | {% endswagger-response %} 49 | 50 | {% swagger-response status="404: Not Found" description="The user does not have a profile image." %} 51 | ```javascript 52 | { 53 | "errors": [ 54 | { 55 | "code": "resource_not_found", 56 | "long_message": "Resource not found", 57 | "message": "not found" 58 | } 59 | ] 60 | } 61 | ``` 62 | {% endswagger-response %} 63 | {% endswagger %} 64 | -------------------------------------------------------------------------------- /reference/frontend-api-reference/users/sessions.md: -------------------------------------------------------------------------------- 1 | # Sessions 2 | 3 | ## Available requests 4 | 5 | * **`GET`**` ``/v1/me/sessions` 6 | * **`GET`**` ``/v1/me/sessions/active` 7 | * **`POST`**`/v1/me/sessions/:id/revoke` 8 | 9 | ## The session object 10 | 11 | ```javascript 12 | { 13 | "object": "session", 14 | "id": "sess_1w1Nn26zzA47J1hYfdO26m4Rxdo", 15 | "status": "active", 16 | "expire_at": 1628227097160, 17 | "abandon_at": 1630214297160, 18 | "last_active_at": 1627622297160, 19 | "user": { 20 | "id": "user_1o4qfqMeCkK4KD9fiCPKIXcA9h8", 21 | "object": "user", 22 | "username": "boss-clerk", 23 | "first_name": "Boss", 24 | "last_name": "Clerk", 25 | "gender": "", 26 | "birthday": "", 27 | "profile_image_url": "https://images.clerk.dev/uploaded/img_1ux177vBXVeUGn4wQXfnr3lSwIg.jpeg", 28 | "primary_email_address_id": "idn_1o4qfak5AdI2qlXSXENGL05iei6", 29 | "primary_phone_number_id": null, 30 | "password_enabled": true, 31 | "two_factor_enabled": false, 32 | "email_addresses": [], 33 | "phone_numbers": [], 34 | "external_accounts": [], 35 | "public_metadata": {}, 36 | "unsafe_metadata": {}, 37 | "created_at": 1612556316784, 38 | "updated_at": 1628205483345 39 | }, 40 | "created_at": 1627622297160, 41 | "updated_at": 1627622297165 42 | } 43 | ``` 44 | 45 | {% swagger baseUrl="https://clerk.example.com" path="/v1/me/sessions" method="get" summary="List all sessions" %} 46 | {% swagger-description %} 47 | Returns a list of the current user's sessions. 48 | {% endswagger-description %} 49 | 50 | {% swagger-response status="200" description="" %} 51 | ```javascript 52 | // see the session object above. 53 | [ 54 | { 55 | "object": "session", 56 | "id": "sess_1w1Nn26zzA47J1hYfdO26m4Rxdo", 57 | ... 58 | }, 59 | ... 60 | ] 61 | ``` 62 | {% endswagger-response %} 63 | {% endswagger %} 64 | 65 | {% swagger baseUrl="https://clerk.example.com" path="/v1/me/sesssions/active" method="get" summary="List all active sessions" %} 66 | {% swagger-description %} 67 | Returns a list of the current user's active sessions. 68 | {% endswagger-description %} 69 | 70 | {% swagger-response status="200" description="" %} 71 | ```javascript 72 | // see the session object above. 73 | [ 74 | { 75 | "object": "session", 76 | "id": "sess_1w1Nn26zzA47J1hYfdO26m4Rxdo", 77 | "status": "active", 78 | ... 79 | }, 80 | ... 81 | ] 82 | ``` 83 | {% endswagger-response %} 84 | {% endswagger %} 85 | 86 | {% swagger baseUrl="https://clerk.example.com" path="/v1/me/sessions/:id/revoke" method="post" summary="Revoke a session" %} 87 | {% swagger-description %} 88 | Revoke the session with the given ID. It will be entirely removed from it's client. You can not revoke the session used to authenticate this request. 89 | {% endswagger-description %} 90 | 91 | {% swagger-parameter in="path" name="id" type="string" %} 92 | ID of the session. 93 | {% endswagger-parameter %} 94 | 95 | {% swagger-response status="200" description="" %} 96 | ```javascript 97 | // see the session object above. 98 | { 99 | "object": "session", 100 | "id": "sess_1w1Nn26zzA47J1hYfdO26m4Rxdo", 101 | "status": "revoked", 102 | ... 103 | } 104 | ``` 105 | {% endswagger-response %} 106 | {% endswagger %} 107 | -------------------------------------------------------------------------------- /reference/frontend-api-reference/users/tokens.md: -------------------------------------------------------------------------------- 1 | # Tokens 2 | 3 | ## Available requests 4 | 5 | * **`POST`**`/v1/me/tokens` 6 | 7 | ## The token object 8 | 9 | ```javascript 10 | { 11 | "object": "token", 12 | "jwt": "eyJhbGciOiJSUzI1NiIsImtpZCI6Imluc18xbHlXRFppb2JyNjAwQUtVZVFEb1NsckVtb00iLCJ0eXAiOiJKV1QifQ.eyJhdWQiOiJjbGVyayIsImVtYWlsIjoiYnJhZGVuQGNsZXJrLmRldiIsImVtYWlsX3ZlcmlmaWVkIjp0cnVlLCJleHAiOjE2MjgyMjE1NzEsImZhbWlseV9uYW1lIjoiU2lkb3RpIiwiZ2l2ZW5fbmFtZSI6IkJyYWRlbiIsImlhdCI6MTYyODIyMTUwNiwiaXNzIjoiaHR0cHM6Ly9jbGVyay5jbGVyay5kZXYiLCJuYW1lIjoiQnJhZGVuIiwicGljdHVyZSI6Imh0dHBzOi8vaW1hZ2VzLmNsZXJrLmRldi91cGxvYWRlZC9pbWdfMXV4MTc3dkJYVmVVR240d1FYZm5yM2xTd0lnLmpwZWciLCJzdWIiOiJ1c2VyXzFvNHFmcU1lQ2tLNEtEOWZpQ1BLSVhjQTloOCIsInVwZGF0ZWRfYXQiOjE2MjgyMTg1Nzd9.b2oZwr8hW33dQC856k5Xv0j-SND3hI11r-j2I6BXkldw-yGnYiKq1GUAwC2F1ecFIaAvVJFHw-MYT34pQt6xMRY_InC2-K7CeDKUIuXzC8fglHU-a8WMp6ehON1MImGy5fuqyyWI6x8vY2TlaKjVipBWFkVDmqLrOWJuuzAePeMaYjN-zPkSOeD1ydiRbGf97wokTGx9hxyYq7C2vX2CLPOkb17f9Is92GcHlatH6Ac6Ptnd_JNy5bXGGjjPKwJgPYO2cCDlxamDgL-40IBJ8l_0IxJWN_PlShZQoT05xGdIJMcnje4WHlt0rm6nQYBPt3Cahz_gd4xoCAeYJEch0A" 13 | } 14 | ``` 15 | 16 | {% swagger baseUrl="https://clerk.example.com" path="/v1/me/tokens" method="post" summary="Create a token" %} 17 | {% swagger-description %} 18 | Create a short-lived JSON Web Token (JWT) structured to be compatible for the specified service. If no service is supplied, you will get a JWT with the `clerk` payload. 19 | 20 | \ 21 | 22 | 23 | 24 | {% endswagger-description %} 25 | 26 | {% swagger-parameter in="body" name="service" type="string" %} 27 | \`clerk`, `firebase`, `hasura` 28 | {% endswagger-parameter %} 29 | 30 | {% swagger-response status="200" description="" %} 31 | ```javascript 32 | { 33 | "object": "token", 34 | "jwt": "eyJhbGciOiJSUzI1NiIsImtpZCI6Imluc18xbHlXRFppb2JyNjAwQUtVZVFEb1NsckVtb00iLCJ0eXAiOiJKV1QifQ.eyJhdWQiOiJjbGVyayIsImVtYWlsIjoiYnJhZGVuQGNsZXJrLmRldiIsImVtYWlsX3ZlcmlmaWVkIjp0cnVlLCJleHAiOjE2MjgyMjE1NzEsImZhbWlseV9uYW1lIjoiU2lkb3RpIiwiZ2l2ZW5fbmFtZSI6IkJyYWRlbiIsImlhdCI6MTYyODIyMTUwNiwiaXNzIjoiaHR0cHM6Ly9jbGVyay5jbGVyay5kZXYiLCJuYW1lIjoiQnJhZGVuIiwicGljdHVyZSI6Imh0dHBzOi8vaW1hZ2VzLmNsZXJrLmRldi91cGxvYWRlZC9pbWdfMXV4MTc3dkJYVmVVR240d1FYZm5yM2xTd0lnLmpwZWciLCJzdWIiOiJ1c2VyXzFvNHFmcU1lQ2tLNEtEOWZpQ1BLSVhjQTloOCIsInVwZGF0ZWRfYXQiOjE2MjgyMTg1Nzd9.b2oZwr8hW33dQC856k5Xv0j-SND3hI11r-j2I6BXkldw-yGnYiKq1GUAwC2F1ecFIaAvVJFHw-MYT34pQt6xMRY_InC2-K7CeDKUIuXzC8fglHU-a8WMp6ehON1MImGy5fuqyyWI6x8vY2TlaKjVipBWFkVDmqLrOWJuuzAePeMaYjN-zPkSOeD1ydiRbGf97wokTGx9hxyYq7C2vX2CLPOkb17f9Is92GcHlatH6Ac6Ptnd_JNy5bXGGjjPKwJgPYO2cCDlxamDgL-40IBJ8l_0IxJWN_PlShZQoT05xGdIJMcnje4WHlt0rm6nQYBPt3Cahz_gd4xoCAeYJEch0A" 35 | } 36 | ``` 37 | {% endswagger-response %} 38 | {% endswagger %} 39 | -------------------------------------------------------------------------------- /reference/frontend-api-reference/users/user.md: -------------------------------------------------------------------------------- 1 | # Current user 2 | 3 | ## Available requests 4 | 5 | * **`GET`**` ``/v1/me` 6 | * **`PATCH`**`/v1/me` 7 | 8 | ## The user object 9 | 10 | ```javascript 11 | { 12 | "id": "user_1o4q123qMeCkKKIXcA9h8", 13 | "object": "user", 14 | "external_id" "my_previous_auth_solution_id", 15 | "username": null, 16 | "first_name": "Boss", 17 | "last_name": "Clerk", 18 | "profile_image_url": "https://images.clerk.dev/uploaded/img_jlkkcq2786n0.jpeg", 19 | "primary_email_address_id": "idn_1o4qfa1caa235iei6", 20 | "primary_phone_number_id": null, 21 | "primary_web3_wallet_id": null, 22 | "password_enabled": true, 23 | "two_factor_enabled": false, 24 | "email_addresses": [ 25 | { 26 | "id": "idn_1o4dI2qlcaXSXE6", 27 | "object": "email_address", 28 | "email_address": "boss@clerk.dev", 29 | "verification": { 30 | "status": "verified", 31 | "strategy": "from_oauth_google" 32 | }, 33 | "linked_to": [ 34 | { 35 | "type": "oauth_google", 36 | "id": "idn_1o4qfbU8Y2345234acClb" 37 | } 38 | ] 39 | } 40 | ], 41 | "phone_numbers": [], 42 | "web3_wallets": [], 43 | "external_accounts": [ 44 | { 45 | "object": "google_account", 46 | "id": "idn_1o4qfbU8YjpJgClb", 47 | "google_id": "10086712340624", 48 | "approved_scopes": "email https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/userinfo.profile openid profile", 49 | "email_address": "boss@clerk.dev", 50 | "given_name": "Boss", 51 | "family_name": "Clerk", 52 | "picture": "https://lh3.googleusercontent.com/a-/AOh14Gl5hWBSGDUdas2341vtMfY6_NUbPx=s1000-c" 53 | } 54 | ], 55 | "public_metadata": {}, 56 | "created_at": 1612556316784, 57 | "updated_at": 1627622297187 58 | } 59 | ``` 60 | 61 | {% swagger baseUrl="https://clerk.example.com" path="/v1/me" method="get" summary="Retrieve current user" %} 62 | {% swagger-description %} 63 | Retrieve the details of the current user. 64 | {% endswagger-description %} 65 | 66 | {% swagger-response status="200" description="" %} 67 | ``` 68 | // User object 69 | { 70 | "id": "user_1oBNj55jOjSK9rOYrT5QHqj7eaK", 71 | "object": "user" 72 | ... 73 | } 74 | ``` 75 | {% endswagger-response %} 76 | {% endswagger %} 77 | 78 | {% swagger baseUrl="https://clerk.example.com" path="/v1/me" method="patch" summary="Update current user" %} 79 | {% swagger-description %} 80 | Updates the current user. 81 | 82 | You can set the current user's primary contact identifiers (email address and phone numbers) by updating the `primary_email_address_id` and `primary_phone_number_id` attributes respectively. Both IDs should correspond to verified identifications that belong to the user. 83 | 84 | You can remove the current user's username by setting the `username` attribute to `null` or the blank string `""`. This is a destructive action. The identification will be deleted forever. 85 | 86 | Usernames can be removed only if they are optional in your instance settings and there's at least one other identifier on the current user which can be used for authentication. 87 | {% endswagger-description %} 88 | 89 | {% swagger-parameter in="body" name="profile_image_id" type="string" %} 90 | The ID of the image to set as the users profile image. 91 | {% endswagger-parameter %} 92 | 93 | {% swagger-parameter in="body" name="primary_email_address_id" type="string" %} 94 | The ID of the email address to set as primary. It must be verified, and present on the current user. 95 | {% endswagger-parameter %} 96 | 97 | {% swagger-parameter in="body" name="primary_phone_number_id" type="string" %} 98 | The ID of the phone number to set as primary. It must be verified, and present on the current user. 99 | {% endswagger-parameter %} 100 | 101 | {% swagger-parameter in="body" name="username" type="string" %} 102 | User's username, must be unique across the instance. 103 | {% endswagger-parameter %} 104 | 105 | {% swagger-parameter in="body" name="first_name" type="string" %} 106 | User's first name. 107 | {% endswagger-parameter %} 108 | 109 | {% swagger-parameter in="body" name="last_name" type="string" %} 110 | User's last name. 111 | {% endswagger-parameter %} 112 | 113 | {% swagger-response status="200" description="" %} 114 | ``` 115 | // User object 116 | { 117 | "id": "user_1oBNj55jOjSK9rOYrT5QHqj7eaK", 118 | "object": "user" 119 | ... 120 | } 121 | ``` 122 | {% endswagger-response %} 123 | {% endswagger %} 124 | -------------------------------------------------------------------------------- /reference/frontend-api-reference/well-known-requests.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: Frontend API .well-known endpoints 3 | --- 4 | 5 | # Well known requests 6 | 7 | ## Available requests 8 | 9 | 10 | 11 | * **`GET`**` ``/.well-known/jwks.json` 12 | * **`GET`**` ``/.well-known/openid-configuration` 13 | 14 | {% swagger method="get" path="/.well-known/jwks.json" baseUrl="https://clerk.example.com" summary="" %} 15 | {% swagger-description %} 16 | Clerk uses [JSON Web Keys (JWK)](https://tools.ietf.org/html/rfc7517) to share the public cryptographic key used to validate the signature of a signed Clerk session JWT. The JWK is unique for each Clerk instance. 17 | 18 | This endpoint is used by the official Clerk Backend SDKs to execute a network-less session JWT verification. The `jwks.json` should be cached in order to validate multiple JWTs without extra network calls. 19 | {% endswagger-description %} 20 | 21 | {% swagger-response status="200: OK" description="" %} 22 | ```json 23 | { 24 | "keys": [ 25 | { 26 | "use": "sig", 27 | "kty": "RSA", 28 | "kid": "ins_1lyWDZiobr600AKUeQDoSlrEmoM", 29 | "alg": "RS256", 30 | "n": "r8T9D2xqXhQ3zMFx3kGYx5NUJ4z1TynESh2YbLdC9WvtUS58TGMWpaku_VOBN7crxWTKC7KsEBbgI88FK_YmHJLuYXUdEPWj_dMnInAxeOMyQhFwuXkIZbU000N62GbpT5_xWFp5UGV_Vsl2try-1nrrD7xzid7DcxVaglvvRBmd51yJayxjEnsLMcRaGvBDDdjpgIVOq5Fz1RO520PFarcKQvlsltnCQbEUtUwprQMxQdE4F9L0D3mY6qV30Yz4mUprVCvwa2xLyaS9Ht6JMf2Uv0Sxvbhoq8H4SN4LysPMGGdTB6zwxpvRlJreOsWaO9HMr91xkAHeS8VqgfVaTw", 31 | "e": "AQAB" 32 | } 33 | ] 34 | } 35 | ``` 36 | {% endswagger-response %} 37 | {% endswagger %} 38 | 39 | {% swagger method="get" path="/.well-known/openid-configuration" baseUrl="https://clerk.example.com" summary="" %} 40 | {% swagger-description %} 41 | A minimal Well-known URI Discovery Mechanism for **** [OpenID Connect](https://openid.net/specs/openid-connect-discovery-1\_0.html) which provides configuration information about Clerk as an Identity Provider (IDP). 42 | 43 | This endpoint can be used by API Gateways that authenticate requests via OIDC SSO such as AWS and GCloud API Gateway. 44 | {% endswagger-description %} 45 | 46 | {% swagger-response status="200: OK" description="" %} 47 | ```javascript 48 | { 49 | "issuer": "https://clerk.clerk.dev", 50 | "jwks_uri": "https://clerk.clerk.dev/.well-known/jwks.json" 51 | } 52 | ``` 53 | {% endswagger-response %} 54 | {% endswagger %} 55 | --------------------------------------------------------------------------------