{"id":20626700,"url":"https://github.com/dimensionsoftware/shopify-passwordless-login","last_synced_at":"2025-04-15T15:21:21.990Z","repository":{"id":35080940,"uuid":"201153083","full_name":"DimensionSoftware/shopify-passwordless-login","owner":"DimensionSoftware","description":"Shopify Passwordless Login Authentication Library with React Native / Expo Examples","archived":false,"fork":false,"pushed_at":"2022-12-06T14:37:41.000Z","size":4189,"stargazers_count":13,"open_issues_count":23,"forks_count":4,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-28T21:51:06.185Z","etag":null,"topics":["authentication","dimensionsoftware","native","passwordless","passwordless-login","react","reactnative"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/DimensionSoftware.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":null,"security":null,"support":null}},"created_at":"2019-08-08T01:18:38.000Z","updated_at":"2024-09-17T11:32:24.000Z","dependencies_parsed_at":"2023-01-15T13:25:48.310Z","dependency_job_id":null,"html_url":"https://github.com/DimensionSoftware/shopify-passwordless-login","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DimensionSoftware%2Fshopify-passwordless-login","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DimensionSoftware%2Fshopify-passwordless-login/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DimensionSoftware%2Fshopify-passwordless-login/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DimensionSoftware%2Fshopify-passwordless-login/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DimensionSoftware","download_url":"https://codeload.github.com/DimensionSoftware/shopify-passwordless-login/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249094941,"owners_count":21211837,"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":["authentication","dimensionsoftware","native","passwordless","passwordless-login","react","reactnative"],"created_at":"2024-11-16T13:14:27.587Z","updated_at":"2025-04-15T15:21:21.972Z","avatar_url":"https://github.com/DimensionSoftware.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n\n# Shopify Passwordless Login\n\n[![Dimension Software][html5-image]][ds-link]\n[![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](https://github.com/DimensionSoftware/shopify-passwordless-login/issues)\n[![HitCount](http://hits.dwyl.io/DimensionSoftware/shopify-passwordless-login.svg)](http://hits.dwyl.io/DimensionSoftware/shopify-passwordless-login)\n[![TypeScript](https://badges.frapsoft.com/typescript/version/typescript-next.svg?v=101)][ds-link]\n\n\u003c/p\u003e\n\n## Native iOS + Android Support\n\n[Login to Shopify, Passwordlessly][pw-link] using this example React Native codebase, no native modules to link \u0026 [Expo friendly!][expo-link]\n\u003cbr /\u003e\n\u003cbr /\u003e\n\n[![Shopify Passwordless Login for React Native Apps][ss-image]][pw-link]\n\n\n## Quick Start\n\n```\n$ yarn add shopify-passwordless-login\n```\n\n\u003cbr /\u003e\n\n#### *Step 1* \u0026nbsp; // \u0026nbsp; [Create a Storefront Access Token][sat-link]\nNavigate to Passwordless Social Login in your Shopify Apps settings and scroll to Optional Install Instructions -\u003e Native Apps.   Paste the created token into this setting, allowing us to generate a CustomerAccessToken for Step 2.\n\nMailing a [secure login link](https://github.com/DimensionSoftware/shopify-passwordless-login/blob/master/examples/react-native/Login.tsx#L26-L39) or [logging in socially](https://github.com/DimensionSoftware/shopify-passwordless-login/blob/master/examples/react-native/Login.tsx#L92-L111) is simple:\n\n```\nimport { login } from 'shopify-passwordless-login'\n\nconst\n  store                    = 'dimensionsoftware', // YOUR-STORE.myshopify.com\n  email                    = 'test@email.com',    // magic link destnation\n  { passwordless, social } = login(store)\n\n// initiate passwordless email\nconst r = await passwordless({ email })\nif (r.success) {\n  // login link successfully mailed\n  alert(`Please check ${email} for a Login Link and Security Code matching ${r.code}`)\n} else {\n  // error\n  console.warn(r.error)\n}\n\n// or, initiate passwordless social\n// SocialParams is one of:  'facebook', 'linkedin', 'twitter', 'google'\nconst uri = social('facebook')\n// uri can then be used as:\n//   - the source for a \u003cWebView /\u003e\n//   - or, to kick-off OAuth, eg. with Google\n```\n\n\u003cbr /\u003e\n\n#### *Step 2* \u0026nbsp; // \u0026nbsp; [Handle your Custom URI Scheme][custom-link]\nNative Apps must respond to a custom URI scheme containing a Shopify CustomerAccessToken which we generate from your Storefront Access Token.  [First edit your app.json](https://github.com/DimensionSoftware/shopify-passwordless-login/blob/master/examples/react-native/app.json#L5) and the rest is simple:\n\n```\nimport { Linking } from 'react-native'\n\n// listen for open url via custom linking scheme\nconst handleRedirect = url =\u003e {\n  if (!url \u0026\u0026 !url.length) return // guard\n  const { path, queryParams } = Linking.parse(url)\n  // path contains your CustomerAccessToken\n  if (path.length)\n    alert(\n      `Linked to app with path: ${path} and data: ${JSON.stringify(\n        queryParams\n      )}`\n    )\n}\nLinking.addEventListener('url', handleRedirect)          // app running in background\nLinking.getInitialURL().then(url =\u003e handleRedirect(url)) // app launched\n\n```\n\n\u003cbr /\u003e\n\n#### Optional *Step 3* \u0026nbsp; // \u0026nbsp; [Cart Checkout and Payment][checkout-link]\nCustomers love your fast \u0026 secure Passwordless flow, loaded their cart up with goods and are ready to checkout!  Passing the CustomerAccessToken through as a header to the webUrl from Shopify's Storefront API Checkout allows for a smooth Payment Gateway transition:\n\n```\nimport { WebView } from 'react-native-webview'\n\n\u003cWebView\n  style={{ flex: 1 }}\n  source={{\n    uri: webUrl, // from Shopify's Storefront API Checkout object\n    headers: {   // from handleRedirect, above\n      'X-Shopify-Customer-Access-Token': customerAccessToken\n    }\n  }}\n  javaScriptEnabled={true}\n  domStorageEnabled={true}\n  startInLoadingState={true}\n/\u003e\n```\n\n\u003cbr /\u003e\n\u003cbr /\u003e\n\u003cbr /\u003e\n\u003cp align=\"center\"\u003e\n\n[![Fresh Software by Dimension][ds-image]][ds-link]\n\n\u003c/p\u003e\n\n[checkout-link]: https://help.shopify.com/en/api/storefront-api/reference/object/checkout\n[custom-link]: https://blog.gisspan.com/2017/02/Implementing-OAuth-on-mobile-Facebook-login-as-example.html\n[sat-link]: https://help.shopify.com/en/api/storefront-api/getting-started\n[pw-link]: https://login.dimensionsoftware.com\n[ds-link]: https://dimensionsoftware.com\n[expo-link]: https://expo.io\n[ss-image]: ./examples/react-native/assets/screenshot.png\n[is-image]: https://dimensionsoftware.com/static/images/layout/dimension_icon.png\n[html5-image]: http://img.shields.io/badge/HTML-5-blue.svg?style=flat\n[ds-image]: https://dimensionsoftware.com/static/images/github/software_by.png\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdimensionsoftware%2Fshopify-passwordless-login","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdimensionsoftware%2Fshopify-passwordless-login","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdimensionsoftware%2Fshopify-passwordless-login/lists"}