@clerk/expo-passkeys 1.0.0-canary.v6652e66d144acf5ce1fe563ee74a88934915e854

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/.eslintrc.js +7 -0
  2. package/LICENSE +21 -0
  3. package/README.md +100 -0
  4. package/android/build.gradle +53 -0
  5. package/android/src/main/AndroidManifest.xml +2 -0
  6. package/android/src/main/java/expo/modules/clerkexpopasskeys/ClerkExpoPasskeysExceptions.kt +140 -0
  7. package/android/src/main/java/expo/modules/clerkexpopasskeys/ClerkExpoPasskeysModule.kt +46 -0
  8. package/android/src/main/java/expo/modules/clerkexpopasskeys/CredentialManager.kt +36 -0
  9. package/app.json +10 -0
  10. package/build/ClerkExpoPasskeys.types.d.ts +61 -0
  11. package/build/ClerkExpoPasskeys.types.d.ts.map +1 -0
  12. package/build/ClerkExpoPasskeys.types.js +2 -0
  13. package/build/ClerkExpoPasskeys.types.js.map +1 -0
  14. package/build/ClerkExpoPasskeysModule.d.ts +3 -0
  15. package/build/ClerkExpoPasskeysModule.d.ts.map +1 -0
  16. package/build/ClerkExpoPasskeysModule.js +5 -0
  17. package/build/ClerkExpoPasskeysModule.js.map +1 -0
  18. package/build/ClerkExpoPasskeysModule.web.d.ts +3 -0
  19. package/build/ClerkExpoPasskeysModule.web.d.ts.map +1 -0
  20. package/build/ClerkExpoPasskeysModule.web.js +2 -0
  21. package/build/ClerkExpoPasskeysModule.web.js.map +1 -0
  22. package/build/index.d.ts +13 -0
  23. package/build/index.d.ts.map +1 -0
  24. package/build/index.js +143 -0
  25. package/build/index.js.map +1 -0
  26. package/build/utils.d.ts +13 -0
  27. package/build/utils.d.ts.map +1 -0
  28. package/build/utils.js +81 -0
  29. package/build/utils.js.map +1 -0
  30. package/expo-module.config.json +9 -0
  31. package/ios/AccountManager.swift +182 -0
  32. package/ios/ClerkExpoPasskeys.podspec +27 -0
  33. package/ios/ClerkExpoPasskeysModule.swift +27 -0
  34. package/ios/Helpers.swift +56 -0
  35. package/package.json +47 -0
  36. package/src/ClerkExpoPasskeys.types.ts +92 -0
  37. package/src/ClerkExpoPasskeysModule.ts +5 -0
  38. package/src/ClerkExpoPasskeysModule.web.ts +1 -0
  39. package/src/index.ts +194 -0
  40. package/src/utils.ts +107 -0
  41. package/tsconfig.json +9 -0
package/.eslintrc.js ADDED
@@ -0,0 +1,7 @@
1
+ module.exports = {
2
+ root: true,
3
+ extends: ['@clerk/custom/node', '@clerk/custom/typescript', '@clerk/custom/react'],
4
+ settings: {
5
+ 'import/ignore': ['node_modules/react-native/index\\.js$'],
6
+ },
7
+ };
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Clerk, Inc.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,100 @@
1
+ <p align="center">
2
+ <a href="https://clerk.com?utm_source=github&utm_medium=clerk_expo_passkeys" target="_blank" rel="noopener noreferrer">
3
+ <picture>
4
+ <source media="(prefers-color-scheme: dark)" srcset="https://images.clerk.com/static/logo-dark-mode-400x400.png">
5
+ <img src="https://images.clerk.com/static/logo-light-mode-400x400.png" height="64">
6
+ </picture>
7
+ </a>
8
+ <br />
9
+ <h1 align="center">@clerk/expo-passkeys</h1>
10
+ </p>
11
+
12
+ <div align="center">
13
+
14
+ [![Chat on Discord](https://img.shields.io/discord/856971667393609759.svg?logo=discord)](https://clerk.com/discord)
15
+ [![Clerk documentation](https://img.shields.io/badge/documentation-clerk-green.svg)](https://clerk.com/docs?utm_source=github&utm_medium=expo_passkeys)
16
+ [![Follow on Twitter](https://img.shields.io/twitter/follow/ClerkDev?style=social)](https://twitter.com/intent/follow?screen_name=ClerkDev)
17
+
18
+ [Changelog](https://github.com/clerk/javascript/blob/main/packages/expo-passkeys/CHANGELOG.md)
19
+ ·
20
+ [Report a Bug](https://github.com/clerk/javascript/issues/new?assignees=&labels=needs-triage&projects=&template=BUG_REPORT.yml)
21
+ ·
22
+ [Request a Feature](https://feedback.clerk.com/roadmap)
23
+ ·
24
+ [Get help](https://clerk.com/contact/support?utm_source=github&utm_medium=expo_passkeys)
25
+
26
+ </div>
27
+
28
+ ### Prerequisites
29
+
30
+ - Expo 51 or later
31
+ - React 18.0.2 or later
32
+ - React Native 0.73 or later
33
+ - Node.js `>=18.17.0` or later
34
+ - An existing Expo application.
35
+ - An existing Clerk application. [Create your account for free](https://dashboard.clerk.com/sign-up?utm_source=github&utm_medium=expo_passkeys).
36
+ - [Passkeys to be enabled ](https://clerk.com/docs/custom-flows/passkeys#enable-passkeys)
37
+
38
+ ## Usage
39
+
40
+ ```tsx
41
+ import { ClerkProvider } from '@clerk/clerk-expo';
42
+ import { passkeys } from '@clerk/clerk-expo/passkeys';
43
+
44
+ <ClerkProvider passkeys={passkeys}>{/* Your app here */}</ClerkProvider>;
45
+ ```
46
+
47
+ ### 🔑 Creating a Passkey
48
+
49
+ ```tsx
50
+ const { user } = useUser();
51
+
52
+ const handleCreatePasskey = async () => {
53
+ if (!user) return;
54
+ try {
55
+ return await user.createPasskey();
56
+ } catch (e: any) {
57
+ // handle error
58
+ }
59
+ };
60
+ ```
61
+
62
+ ### 🔓 Authenticating with a Passkey
63
+
64
+ ```tsx
65
+ const { signIn, setActive } = useSignIn();
66
+
67
+ const handlePasskeySignIn = async () => {
68
+ try {
69
+ const signInResponse = await signIn.authenticateWithPasskey();
70
+ await setActive({ session: signInResponse.createdSessionId });
71
+ } catch (err: any) {
72
+ // handle error
73
+ }
74
+ };
75
+ ```
76
+
77
+ ## Support
78
+
79
+ You can get in touch with us in any of the following ways:
80
+
81
+ - Join our official community [Discord server](https://clerk.com/discord)
82
+ - On [our support page](https://clerk.com/contact/support?utm_source=github&utm_medium=expo_passkeys)
83
+
84
+ ## Contributing
85
+
86
+ We're open to all community contributions! If you'd like to contribute in any way, please read [our contribution guidelines](https://github.com/clerk/javascript/blob/main/docs/CONTRIBUTING.md) and [code of conduct](https://github.com/clerk/javascript/blob/main/docs/CODE_OF_CONDUCT.md).
87
+
88
+ ## Security
89
+
90
+ `@clerk/expo-passkeys` follows good practices of security, but 100% security cannot be assured.
91
+
92
+ `@clerk/expo-passkeys` is provided **"as is"** without any **warranty**. Use at your own risk.
93
+
94
+ _For more information and to report security issues, please refer to our [security documentation](https://github.com/clerk/javascript/blob/main/docs/SECURITY.md)._
95
+
96
+ ## License
97
+
98
+ This project is licensed under the **MIT license**.
99
+
100
+ See [LICENSE](https://github.com/clerk/javascript/blob/main/packages/expo-passkeys/LICENSE) for more information.
@@ -0,0 +1,53 @@
1
+ apply plugin: 'com.android.library'
2
+ apply plugin: 'kotlin-android'
3
+ apply plugin: 'maven-publish'
4
+
5
+ group = 'expo.modules.clerkexpopasskeys'
6
+ version = '1.0.0'
7
+
8
+ def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle")
9
+ apply from: expoModulesCorePlugin
10
+ applyKotlinExpoModulesCorePlugin()
11
+ useCoreDependencies()
12
+ useExpoPublishing()
13
+
14
+ // If you want to use the managed Android SDK versions from expo-modules-core, set this to true.
15
+ // The Android SDK versions will be bumped from time to time in SDK releases and may introduce breaking changes in your module code.
16
+ // Most of the time, you may like to manage the Android SDK versions yourself.
17
+ def useManagedAndroidSdkVersions = false
18
+ if (useManagedAndroidSdkVersions) {
19
+ useDefaultAndroidSdkVersions()
20
+ } else {
21
+ buildscript {
22
+ // Simple helper that allows the root project to override versions declared by this library.
23
+ ext.safeExtGet = { prop, fallback ->
24
+ rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
25
+ }
26
+ }
27
+ project.android {
28
+ compileSdkVersion safeExtGet("compileSdkVersion", 34)
29
+ defaultConfig {
30
+ minSdkVersion safeExtGet("minSdkVersion", 21)
31
+ targetSdkVersion safeExtGet("targetSdkVersion", 35)
32
+ }
33
+ }
34
+ }
35
+
36
+ android {
37
+ namespace "expo.modules.clerkexpopasskeys"
38
+ defaultConfig {
39
+ versionCode 1
40
+ versionName "1.0.0"
41
+ }
42
+ lintOptions {
43
+ abortOnError false
44
+ }
45
+ }
46
+
47
+ dependencies {
48
+ implementation project(':expo-modules-core')
49
+ implementation("androidx.credentials:credentials:1.3.0-rc01")
50
+ implementation("androidx.credentials:credentials-play-services-auth:1.3.0-rc01")
51
+
52
+ implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3"
53
+ }
@@ -0,0 +1,2 @@
1
+ <manifest>
2
+ </manifest>
@@ -0,0 +1,140 @@
1
+ package expo.modules.clerkexpopasskeys
2
+
3
+ import androidx.credentials.exceptions.CreateCredentialCancellationException
4
+ import androidx.credentials.exceptions.CreateCredentialCustomException
5
+ import androidx.credentials.exceptions.CreateCredentialException
6
+ import androidx.credentials.exceptions.CreateCredentialInterruptedException
7
+ import androidx.credentials.exceptions.CreateCredentialProviderConfigurationException
8
+ import androidx.credentials.exceptions.CreateCredentialUnknownException
9
+ import androidx.credentials.exceptions.GetCredentialCancellationException
10
+ import androidx.credentials.exceptions.GetCredentialException
11
+ import androidx.credentials.exceptions.GetCredentialInterruptedException
12
+ import androidx.credentials.exceptions.GetCredentialProviderConfigurationException
13
+ import androidx.credentials.exceptions.GetCredentialUnknownException
14
+ import androidx.credentials.exceptions.GetCredentialUnsupportedException
15
+ import androidx.credentials.exceptions.NoCredentialException
16
+ import androidx.credentials.exceptions.publickeycredential.CreatePublicKeyCredentialDomException
17
+ import androidx.credentials.exceptions.publickeycredential.GetPublicKeyCredentialDomException
18
+ import expo.modules.kotlin.Promise
19
+
20
+ //https://developer.android.com/identity/sign-in/credential-manager#create-passkey
21
+ fun handleCreationFailure(e: CreateCredentialException, promise: Promise) {
22
+ when (e) {
23
+ is CreatePublicKeyCredentialDomException -> {
24
+ // Handle the passkey DOM errors thrown according to the
25
+ // WebAuthn spec.
26
+ promise.reject("CreatePublicKeyCredentialDomException", e.domError.toString(), e)
27
+ }
28
+
29
+ is CreateCredentialCancellationException -> {
30
+ // The user intentionally canceled the operation and chose not
31
+ // to register the credential.
32
+ promise.reject(
33
+ "CreateCredentialCancellationException", e.message,
34
+ e
35
+ )
36
+
37
+
38
+ }
39
+
40
+ is CreateCredentialInterruptedException -> {
41
+ // Retry-able error. Consider retrying the call.
42
+ promise.reject(
43
+ "CreateCredentialInterruptedException",
44
+ e.message,
45
+ e
46
+ )
47
+ }
48
+
49
+ is CreateCredentialProviderConfigurationException -> {
50
+ // Your app is missing the provider configuration dependency.
51
+ // Most likely, you're missing the
52
+ // "credentials-play-services-auth" module.
53
+ promise.reject(
54
+ "CreateCredentialProviderConfigurationException",
55
+ e.message,
56
+ e
57
+ )
58
+ }
59
+
60
+ is CreateCredentialUnknownException -> {
61
+ promise.reject(
62
+ "CreateCredentialUnknownException",
63
+ e.message,
64
+ e
65
+ )
66
+ }
67
+
68
+ is CreateCredentialCustomException -> {
69
+ // You have encountered an error from a 3rd-party SDK. If you
70
+ // make the API call with a request object that's a subclass of
71
+ // CreateCustomCredentialRequest using a 3rd-party SDK, then you
72
+ // should check for any custom exception type constants within
73
+ // that SDK to match with e.type. Otherwise, drop or log the
74
+ // exception.
75
+ promise.reject(
76
+ "CreateCredentialCustomException",
77
+ e.message,
78
+ e
79
+ )
80
+ }
81
+
82
+ else -> promise.reject("Error", e.message, e)
83
+ }
84
+ }
85
+
86
+ fun handleGetFailure(e: GetCredentialException, promise: Promise) {
87
+
88
+ when (e) {
89
+ is GetPublicKeyCredentialDomException -> {
90
+ promise.reject("GetPublicKeyCredentialDomException", e.domError.toString(), e)
91
+ }
92
+
93
+ is GetCredentialInterruptedException -> {
94
+ promise.reject("GetCredentialInterruptedException", e.message, e)
95
+ }
96
+
97
+ is GetCredentialCancellationException -> {
98
+ promise.reject(
99
+ "GetCredentialCancellationException",
100
+ e.message,
101
+ e
102
+ )
103
+ }
104
+
105
+ is GetCredentialUnknownException -> {
106
+ promise.reject("GetCredentialUnknownException", e.message, e)
107
+ }
108
+
109
+
110
+ is GetCredentialProviderConfigurationException -> {
111
+ promise.reject(
112
+ "GetCredentialProviderConfigurationException",
113
+ e.message,
114
+ e
115
+ )
116
+ }
117
+
118
+
119
+ is GetCredentialUnsupportedException -> {
120
+ promise.reject(
121
+ "GetCredentialUnsupportedException",
122
+ e.message,
123
+ e
124
+ )
125
+ }
126
+
127
+ is NoCredentialException -> {
128
+ promise.reject(
129
+ "NoCredentialException",
130
+ e.message,
131
+ e
132
+ )
133
+ }
134
+
135
+ else -> {
136
+ promise.reject("Error", e.message, e)
137
+ }
138
+ }
139
+
140
+ }
@@ -0,0 +1,46 @@
1
+ package expo.modules.clerkexpopasskeys
2
+
3
+ import androidx.credentials.exceptions.CreateCredentialException
4
+ import androidx.credentials.exceptions.GetCredentialException
5
+ import expo.modules.kotlin.Promise
6
+ import expo.modules.kotlin.modules.Module
7
+ import expo.modules.kotlin.modules.ModuleDefinition
8
+ import kotlinx.coroutines.CoroutineScope
9
+ import kotlinx.coroutines.Dispatchers
10
+ import kotlinx.coroutines.launch
11
+
12
+ class ClerkExpoPasskeysModule : Module() {
13
+ private val mCoroutine = CoroutineScope(Dispatchers.Default)
14
+
15
+ override fun definition() = ModuleDefinition {
16
+ Name("ClerkExpoPasskeys")
17
+
18
+ AsyncFunction("create") { request: String, promise: Promise ->
19
+
20
+ mCoroutine.launch {
21
+ try {
22
+ val response = createPasskey(request, appContext)
23
+ promise.resolve(response)
24
+
25
+ } catch (e: CreateCredentialException) {
26
+ handleCreationFailure(e, promise)
27
+ }
28
+ }
29
+
30
+ }
31
+
32
+ AsyncFunction("get") { request: String, promise: Promise ->
33
+
34
+ mCoroutine.launch {
35
+ try {
36
+ val response = getPasskey(request, appContext)
37
+ promise.resolve(response)
38
+ } catch (e: GetCredentialException) {
39
+ handleGetFailure(e, promise)
40
+ }
41
+ }
42
+ }
43
+
44
+
45
+ }
46
+ }
@@ -0,0 +1,36 @@
1
+ package expo.modules.clerkexpopasskeys
2
+
3
+ import androidx.credentials.CreatePublicKeyCredentialRequest
4
+ import androidx.credentials.CredentialManager
5
+ import androidx.credentials.GetCredentialRequest
6
+ import androidx.credentials.GetPublicKeyCredentialOption
7
+ import expo.modules.kotlin.AppContext
8
+
9
+ suspend fun createPasskey(
10
+ request: String,
11
+ appContext: AppContext,
12
+ ): String? {
13
+ val credentialManager =
14
+ CredentialManager.create(appContext.reactContext?.applicationContext!!)
15
+ val createRequest = CreatePublicKeyCredentialRequest(request)
16
+
17
+ var response = appContext.activityProvider?.currentActivity?.let {
18
+ credentialManager.createCredential(it, createRequest)
19
+ }
20
+ return response?.data?.getString("androidx.credentials.BUNDLE_KEY_REGISTRATION_RESPONSE_JSON")
21
+ }
22
+
23
+ suspend fun getPasskey(
24
+ request: String,
25
+ appContext: AppContext,
26
+ ): String? {
27
+ val credentialManager =
28
+ CredentialManager.create(appContext.reactContext?.applicationContext!!)
29
+ val getCredentialRequest =
30
+ GetCredentialRequest(listOf(GetPublicKeyCredentialOption(request)))
31
+
32
+ val result = appContext.activityProvider?.currentActivity?.let {
33
+ credentialManager.getCredential(it, getCredentialRequest)
34
+ }
35
+ return result?.credential?.data?.getString("androidx.credentials.BUNDLE_KEY_AUTHENTICATION_RESPONSE_JSON")
36
+ }
package/app.json ADDED
@@ -0,0 +1,10 @@
1
+ {
2
+ "expo": {
3
+ "name": "expo-passkeys",
4
+ "slug": "expo-passkeys",
5
+ "version": "1.0.0",
6
+ "description": "Passkeys for expo built by Clerk team",
7
+ "sdkVersion": "51.0.0",
8
+ "platforms": ["ios", "android"]
9
+ }
10
+ }
@@ -0,0 +1,61 @@
1
+ import type { CredentialReturn, PublicKeyCredentialCreationOptionsWithoutExtensions, PublicKeyCredentialRequestOptionsWithoutExtensions, PublicKeyCredentialWithAuthenticatorAssertionResponse as ClerkPublicKeyCredentialWithAuthenticatorAssertionResponse, PublicKeyCredentialWithAuthenticatorAttestationResponse as ClerkPublicKeyCredentialWithAuthenticatorAttestationResponse } from '@clerk/types';
2
+ export type { PublicKeyCredentialRequestOptionsWithoutExtensions, PublicKeyCredentialCreationOptionsWithoutExtensions, CredentialReturn, };
3
+ type AuthenticatorTransportFuture = 'ble' | 'cable' | 'hybrid' | 'internal' | 'nfc' | 'smart-card' | 'usb';
4
+ interface PublicKeyCredentialDescriptorJSON {
5
+ id: string;
6
+ type: PublicKeyCredentialType;
7
+ transports?: AuthenticatorTransportFuture[];
8
+ }
9
+ export type SerializedPublicKeyCredentialCreationOptions = Pick<PublicKeyCredentialCreationOptionsWithoutExtensions, 'authenticatorSelection' | 'pubKeyCredParams'> & {
10
+ rp: {
11
+ id: string;
12
+ name: string;
13
+ };
14
+ user: {
15
+ id: string;
16
+ displayName: string;
17
+ name: string;
18
+ };
19
+ challenge: string;
20
+ excludeCredentials?: PublicKeyCredentialDescriptorJSON[];
21
+ };
22
+ export type SerializedPublicKeyCredentialRequestOptions = Omit<PublicKeyCredentialRequestOptionsWithoutExtensions, 'challenge'> & {
23
+ challenge: string;
24
+ };
25
+ export interface AuthenticationResponseJSON {
26
+ id: string;
27
+ rawId: string;
28
+ response: AuthenticatorAssertionResponseJSON;
29
+ authenticatorAttachment?: AuthenticatorAttachment;
30
+ clientExtensionResults: AuthenticationExtensionsClientOutputs;
31
+ type: PublicKeyCredentialType;
32
+ }
33
+ export type PublicKeyCredentialWithAuthenticatorAttestationResponse = ClerkPublicKeyCredentialWithAuthenticatorAttestationResponse & {
34
+ toJSON: () => any;
35
+ };
36
+ interface AuthenticatorAssertionResponseJSON {
37
+ clientDataJSON: string;
38
+ authenticatorData: string;
39
+ signature: string;
40
+ userHandle?: string;
41
+ }
42
+ export type PublicKeyCredentialWithAuthenticatorAssertionResponse = ClerkPublicKeyCredentialWithAuthenticatorAssertionResponse & {
43
+ toJSON: () => any;
44
+ };
45
+ interface AuthenticatorAttestationResponseJSON {
46
+ clientDataJSON: string;
47
+ attestationObject: string;
48
+ authenticatorData?: string;
49
+ transports?: AuthenticatorTransportFuture[];
50
+ publicKeyAlgorithm?: COSEAlgorithmIdentifier;
51
+ publicKey?: string;
52
+ }
53
+ export interface RegistrationResponseJSON {
54
+ id: string;
55
+ rawId: string;
56
+ response: AuthenticatorAttestationResponseJSON;
57
+ authenticatorAttachment?: AuthenticatorAttachment;
58
+ clientExtensionResults: AuthenticationExtensionsClientOutputs;
59
+ type: PublicKeyCredentialType;
60
+ }
61
+ //# sourceMappingURL=ClerkExpoPasskeys.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ClerkExpoPasskeys.types.d.ts","sourceRoot":"","sources":["../src/ClerkExpoPasskeys.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAChB,mDAAmD,EACnD,kDAAkD,EAClD,qDAAqD,IAAI,0DAA0D,EACnH,uDAAuD,IAAI,4DAA4D,EACxH,MAAM,cAAc,CAAC;AAEtB,YAAY,EACV,kDAAkD,EAClD,mDAAmD,EACnD,gBAAgB,GACjB,CAAC;AAEF,KAAK,4BAA4B,GAAG,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,UAAU,GAAG,KAAK,GAAG,YAAY,GAAG,KAAK,CAAC;AAE3G,UAAU,iCAAiC;IACzC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,uBAAuB,CAAC;IAC9B,UAAU,CAAC,EAAE,4BAA4B,EAAE,CAAC;CAC7C;AAGD,MAAM,MAAM,4CAA4C,GAAG,IAAI,CAC7D,mDAAmD,EACnD,wBAAwB,GAAG,kBAAkB,CAC9C,GAAG;IACF,EAAE,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IACjC,IAAI,EAAE;QACJ,EAAE,EAAE,MAAM,CAAC;QACX,WAAW,EAAE,MAAM,CAAC;QACpB,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;IACF,SAAS,EAAE,MAAM,CAAC;IAClB,kBAAkB,CAAC,EAAE,iCAAiC,EAAE,CAAC;CAC1D,CAAC;AAGF,MAAM,MAAM,2CAA2C,GAAG,IAAI,CAC5D,kDAAkD,EAClD,WAAW,CACZ,GAAG;IACF,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAGF,MAAM,WAAW,0BAA0B;IACzC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,kCAAkC,CAAC;IAC7C,uBAAuB,CAAC,EAAE,uBAAuB,CAAC;IAClD,sBAAsB,EAAE,qCAAqC,CAAC;IAC9D,IAAI,EAAE,uBAAuB,CAAC;CAC/B;AAGD,MAAM,MAAM,uDAAuD,GACjE,4DAA4D,GAAG;IAC7D,MAAM,EAAE,MAAM,GAAG,CAAC;CACnB,CAAC;AAEJ,UAAU,kCAAkC;IAC1C,cAAc,EAAE,MAAM,CAAC;IACvB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAGD,MAAM,MAAM,qDAAqD,GAC/D,0DAA0D,GAAG;IAC3D,MAAM,EAAE,MAAM,GAAG,CAAC;CACnB,CAAC;AAEJ,UAAU,oCAAoC;IAC5C,cAAc,EAAE,MAAM,CAAC;IACvB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,UAAU,CAAC,EAAE,4BAA4B,EAAE,CAAC;IAC5C,kBAAkB,CAAC,EAAE,uBAAuB,CAAC;IAC7C,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAGD,MAAM,WAAW,wBAAwB;IACvC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,oCAAoC,CAAC;IAC/C,uBAAuB,CAAC,EAAE,uBAAuB,CAAC;IAClD,sBAAsB,EAAE,qCAAqC,CAAC;IAC9D,IAAI,EAAE,uBAAuB,CAAC;CAC/B"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=ClerkExpoPasskeys.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ClerkExpoPasskeys.types.js","sourceRoot":"","sources":["../src/ClerkExpoPasskeys.types.ts"],"names":[],"mappings":"","sourcesContent":["import type {\n CredentialReturn,\n PublicKeyCredentialCreationOptionsWithoutExtensions,\n PublicKeyCredentialRequestOptionsWithoutExtensions,\n PublicKeyCredentialWithAuthenticatorAssertionResponse as ClerkPublicKeyCredentialWithAuthenticatorAssertionResponse,\n PublicKeyCredentialWithAuthenticatorAttestationResponse as ClerkPublicKeyCredentialWithAuthenticatorAttestationResponse,\n} from '@clerk/types';\n\nexport type {\n PublicKeyCredentialRequestOptionsWithoutExtensions,\n PublicKeyCredentialCreationOptionsWithoutExtensions,\n CredentialReturn,\n};\n\ntype AuthenticatorTransportFuture = 'ble' | 'cable' | 'hybrid' | 'internal' | 'nfc' | 'smart-card' | 'usb';\n\ninterface PublicKeyCredentialDescriptorJSON {\n id: string;\n type: PublicKeyCredentialType;\n transports?: AuthenticatorTransportFuture[];\n}\n\n// The serialized JSON to send to \"create\" native module\nexport type SerializedPublicKeyCredentialCreationOptions = Pick<\n PublicKeyCredentialCreationOptionsWithoutExtensions,\n 'authenticatorSelection' | 'pubKeyCredParams'\n> & {\n rp: { id: string; name: string };\n user: {\n id: string;\n displayName: string;\n name: string;\n };\n challenge: string;\n excludeCredentials?: PublicKeyCredentialDescriptorJSON[];\n};\n\n// The serialized JSON to send to \"get\" native module\nexport type SerializedPublicKeyCredentialRequestOptions = Omit<\n PublicKeyCredentialRequestOptionsWithoutExtensions,\n 'challenge'\n> & {\n challenge: string;\n};\n\n// The return type from the \"get\" native module.\nexport interface AuthenticationResponseJSON {\n id: string;\n rawId: string;\n response: AuthenticatorAssertionResponseJSON;\n authenticatorAttachment?: AuthenticatorAttachment;\n clientExtensionResults: AuthenticationExtensionsClientOutputs;\n type: PublicKeyCredentialType;\n}\n\n// The serialized response of the native module \"create\" response to be send back to clerk\nexport type PublicKeyCredentialWithAuthenticatorAttestationResponse =\n ClerkPublicKeyCredentialWithAuthenticatorAttestationResponse & {\n toJSON: () => any;\n };\n\ninterface AuthenticatorAssertionResponseJSON {\n clientDataJSON: string;\n authenticatorData: string;\n signature: string;\n userHandle?: string;\n}\n\n// The serialized response of the native module \"get\" response to be send back to clerk\nexport type PublicKeyCredentialWithAuthenticatorAssertionResponse =\n ClerkPublicKeyCredentialWithAuthenticatorAssertionResponse & {\n toJSON: () => any;\n };\n\ninterface AuthenticatorAttestationResponseJSON {\n clientDataJSON: string;\n attestationObject: string;\n authenticatorData?: string;\n transports?: AuthenticatorTransportFuture[];\n publicKeyAlgorithm?: COSEAlgorithmIdentifier;\n publicKey?: string;\n}\n\n// The type is returned from from native module \"create\" response\nexport interface RegistrationResponseJSON {\n id: string;\n rawId: string;\n response: AuthenticatorAttestationResponseJSON;\n authenticatorAttachment?: AuthenticatorAttachment;\n clientExtensionResults: AuthenticationExtensionsClientOutputs;\n type: PublicKeyCredentialType;\n}\n"]}
@@ -0,0 +1,3 @@
1
+ declare const _default: any;
2
+ export default _default;
3
+ //# sourceMappingURL=ClerkExpoPasskeysModule.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ClerkExpoPasskeysModule.d.ts","sourceRoot":"","sources":["../src/ClerkExpoPasskeysModule.ts"],"names":[],"mappings":";AAIA,wBAAwD"}
@@ -0,0 +1,5 @@
1
+ import { requireNativeModule } from 'expo-modules-core';
2
+ // It loads the native module object from the JSI or falls back to
3
+ // the bridge module (from NativeModulesProxy) if the remote debugger is on.
4
+ export default requireNativeModule('ClerkExpoPasskeys');
5
+ //# sourceMappingURL=ClerkExpoPasskeysModule.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ClerkExpoPasskeysModule.js","sourceRoot":"","sources":["../src/ClerkExpoPasskeysModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAExD,kEAAkE;AAClE,4EAA4E;AAC5E,eAAe,mBAAmB,CAAC,mBAAmB,CAAC,CAAC","sourcesContent":["import { requireNativeModule } from 'expo-modules-core';\n\n// It loads the native module object from the JSI or falls back to\n// the bridge module (from NativeModulesProxy) if the remote debugger is on.\nexport default requireNativeModule('ClerkExpoPasskeys');\n"]}
@@ -0,0 +1,3 @@
1
+ declare const _default: {};
2
+ export default _default;
3
+ //# sourceMappingURL=ClerkExpoPasskeysModule.web.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ClerkExpoPasskeysModule.web.d.ts","sourceRoot":"","sources":["../src/ClerkExpoPasskeysModule.web.ts"],"names":[],"mappings":";AAAA,wBAAkB"}
@@ -0,0 +1,2 @@
1
+ export default {};
2
+ //# sourceMappingURL=ClerkExpoPasskeysModule.web.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ClerkExpoPasskeysModule.web.js","sourceRoot":"","sources":["../src/ClerkExpoPasskeysModule.web.ts"],"names":[],"mappings":"AAAA,eAAe,EAAE,CAAC","sourcesContent":["export default {};\n"]}
@@ -0,0 +1,13 @@
1
+ import type { CredentialReturn, PublicKeyCredentialCreationOptionsWithoutExtensions, PublicKeyCredentialRequestOptionsWithoutExtensions, PublicKeyCredentialWithAuthenticatorAssertionResponse, PublicKeyCredentialWithAuthenticatorAttestationResponse } from './ClerkExpoPasskeys.types';
2
+ export declare function create(publicKey: PublicKeyCredentialCreationOptionsWithoutExtensions): Promise<CredentialReturn<PublicKeyCredentialWithAuthenticatorAttestationResponse>>;
3
+ export declare function get({ publicKeyOptions, }: {
4
+ publicKeyOptions: PublicKeyCredentialRequestOptionsWithoutExtensions;
5
+ }): Promise<CredentialReturn<PublicKeyCredentialWithAuthenticatorAssertionResponse>>;
6
+ export declare function isSupported(): boolean;
7
+ export declare const passkeys: {
8
+ create: typeof create;
9
+ get: typeof get;
10
+ isSupported: typeof isSupported;
11
+ isAutoFillSupported: () => never;
12
+ };
13
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAEV,gBAAgB,EAChB,mDAAmD,EACnD,kDAAkD,EAClD,qDAAqD,EACrD,uDAAuD,EAIxD,MAAM,2BAA2B,CAAC;AA0BnC,wBAAsB,MAAM,CAC1B,SAAS,EAAE,mDAAmD,GAC7D,OAAO,CAAC,gBAAgB,CAAC,uDAAuD,CAAC,CAAC,CAsDpF;AAsBD,wBAAsB,GAAG,CAAC,EACxB,gBAAgB,GACjB,EAAE;IACD,gBAAgB,EAAE,kDAAkD,CAAC;CACtE,GAAG,OAAO,CAAC,gBAAgB,CAAC,qDAAqD,CAAC,CAAC,CAmCnF;AAKD,wBAAgB,WAAW,YAU1B;AAgBD,eAAO,MAAM,QAAQ;;;;;CAOpB,CAAC"}