{"id":18520959,"url":"https://github.com/charlescreativecontent/stytch-netlify-sms-2","last_synced_at":"2025-05-14T17:35:11.589Z","repository":{"id":237455447,"uuid":"645993158","full_name":"CharlesCreativeContent/stytch-netlify-sms-2","owner":"CharlesCreativeContent","description":null,"archived":false,"fork":false,"pushed_at":"2023-05-27T00:38:03.000Z","size":128,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-17T05:15:34.212Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CharlesCreativeContent.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-05-27T00:36:26.000Z","updated_at":"2023-11-23T23:41:32.000Z","dependencies_parsed_at":null,"dependency_job_id":"0e60332f-afe3-4e7c-b0d3-3351dd76142f","html_url":"https://github.com/CharlesCreativeContent/stytch-netlify-sms-2","commit_stats":null,"previous_names":["charlescreativecontent/stytch-netlify-sms-2"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CharlesCreativeContent%2Fstytch-netlify-sms-2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CharlesCreativeContent%2Fstytch-netlify-sms-2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CharlesCreativeContent%2Fstytch-netlify-sms-2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CharlesCreativeContent%2Fstytch-netlify-sms-2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CharlesCreativeContent","download_url":"https://codeload.github.com/CharlesCreativeContent/stytch-netlify-sms-2/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254194821,"owners_count":22030429,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-06T17:23:39.549Z","updated_at":"2025-05-14T17:35:11.543Z","avatar_url":"https://github.com/CharlesCreativeContent.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Stytch Netlify example application\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://user-images.githubusercontent.com/100632220/217049841-b9eeb72a-3e50-4074-839a-e64ee5d4a88c.png\" width=\"750\"\u003e\n\u003c/p\u003e\n\n## Overview\n\nThis example application demonstrates how one may use Stytch within a Next.js application running on [Netlify](https://www.netlify.com/integrations/stytch/).\n\nThis project uses Stytch's [Next.js SDK](https://stytch.com/docs/sdks/javascript-sdk) which provides pre-built UI components, useful React hooks, headless methods to securely interact with Stytch, and is SSR friendly. This project also utilizes Stytch's [Node Backend SDK](https://www.npmjs.com/package/stytch) for authenticating the logged in user's session.  \n\nThis application features Email Magic Links and Google OAuth authentication. You can use this application's source code as a learning resource, or use it as a jumping off point for your own project. We are excited to see what you build with Stytch!\n\n## Set up\n\nFollow the steps below to get this application fully functional and running using your own Stytch credentials.\n\n### In the Stytch Dashboard\n\n1. Create a [Stytch](https://stytch.com/) account. Once your account is set up a Project called \"My first project\" will be automatically created for you.\n\n2. Within your new Project, navigate to [Frontend SDKs](https://stytch.com/dashboard/sdk-configuration), and make the following changes:\n\n   - Click **Enable SDK**.\n   - Under **Authorized applications** add the domain `http://localhost:8888`.\n\n3. Navigate to [Redirect URLs](https://stytch.com/dashboard/redirect-urls), and add `http://localhost:8888/authenticate` as the types **Login** and **Sign-up**.\n\n4. Navigate to [OAuth](https://stytch.com/dashboard/oauth), and set up login for Google in the Test environment. Follow all the instructions provided in the Dashboard. If you are not interested in OAuth login you can skip this step. However, the _Continue with Google_ button in this application will not work.\n   \n   \u003cimg width=\"400\" alt=\"OAuth configuration\" src=\"https://user-images.githubusercontent.com/100632220/217055674-a7dafc17-6ad3-492f-8dd2-92560d60dc00.png\"\u003e\n\n5. Finally, navigate to [API Keys](https://stytch.com/dashboard/api-keys). You will need the `project_id`, `secret`, and `public_token` values found on this page later on.\n\n### Running the app\nIn your terminal clone the project and install dependencies:\n\n```bash\ngit clone https://github.com/stytchauth/stytch-netlify-example\ncd stytch-netlify-example\nnpm i\nnpm install netlify-cli -g\n```\n\nNext, create `.env.local` file by running the command below which copies the contents of `.env.template`. If you'd like to run the app via Netlify instead of locally, you can skip this step and head straight to the [Running the app on Netlify](#running-the-app-on-netlify) section.\n```bash\ncp .env.template .env.local\n```\n\nOpen `.env.local` in the text editor of your choice, and set the environment variables using the `project_id`, `secret`, and `public_token` found on [API Keys](https://stytch.com/dashboard/api-keys). Leave the `STYTCH_PROJECT_ENV` value as `test`.\n\n```\n# This is what a completed .env.local file will look like\nSTYTCH_PROJECT_ENV=test\nSTYTCH_PROJECT_ID=project-test-00000000-0000-1234-abcd-abcdef1234\nNEXT_PUBLIC_STYTCH_PUBLIC_TOKEN=public-token-test-abcd123-0000-0000-abcd-1234567abc\nSTYTCH_SECRET=secret-test-12345678901234567890abcdabcd\n```\n\n## Running the app on Netlify\nClick the button below to deploy this application to Netlify. This will create a new Netlify site and deploy the application to it. You will be prompted to enter your Stytch [API Keys](https://stytch.com/dashboard/api-keys). \n\nNote, you'll need to add your Netlify's site domain to the [Redirect URLs](https://stytch.com/dashboard/redirect-urls), e.g. `https://main--wonderful-salmiakki-f95458.netlify.app/authenticate`, and [Authorized applications](https://stytch.com/dashboard/sdk-configuration) in your Stytch Dashboard, e.g. `https://main--wonderful-salmiakki-f95458.netlify.app`. \n\n[![Deploy to Netlify](https://www.netlify.com/img/deploy/button.svg)](https://app.netlify.com/start/deploy?repository=https://github.com/stytchauth/stytch-netlify-example)\n\n## Running the app locally\nIf you want to run the app locally, the app may be run with the command:\n\n```bash\nnetlify dev\n```\n\nThe application will be available at [`http://localhost:8888`](http://localhost:8888).\n\nYou'll be able to login with Email Magic Links or Google OAuth and see your Stytch User object, Stytch Session, and see how logging out works.\n\n## Next steps\n\nThis example app showcases a small portion of what you can accomplish with Stytch. Here are a few ideas to explore:\n\n1. Add additional login methods like [Passwords](https://stytch.com/docs/passwords#guides_getting-started-sdk).\n2. Replace the prebuilt UI with your own using by using the SDK's [headless methods](https://stytch.com/docs/sdks/javascript-sdk).\n3. Replace the Google OAuth button with the high converting [Google One Tap UI](https://stytch.com/docs/oauth#guides_google-sdk).\n4. Secure your app further by building MFA authentication using methods like [WebAuthn](https://stytch.com/docs/sdks/javascript-sdk#webauthn).\n\n## Get help and join the community\n\n#### :speech_balloon: Stytch community Slack\n\nJoin the discussion, ask questions, and suggest new features in our ​[Slack community](https://join.slack.com/t/stytch/shared_invite/zt-nil4wo92-jApJ9Cl32cJbEd9esKkvyg)!\n\n#### :question: Need support?\n\nCheck out the [Stytch Forum](https://forum.stytch.com/) or email us at [support@stytch.com](mailto:support@stytch.com).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcharlescreativecontent%2Fstytch-netlify-sms-2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcharlescreativecontent%2Fstytch-netlify-sms-2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcharlescreativecontent%2Fstytch-netlify-sms-2/lists"}