@plainkey/vue 0.7.0 → 0.8.0

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.
package/dist/index.d.ts CHANGED
@@ -6,7 +6,7 @@ import { UserIdentifier } from "@plainkey/types";
6
6
  /**
7
7
  *
8
8
  * @param projectId - Your PlainKey project ID. You can find it in the PlainKey admin dashboard.
9
- * @param baseUrl - Set by default to https://api.plainkey.io/api. Change only for development purposes.
9
+ * @param baseUrl - Set by default to https://api.plainkey.io/browser. Change only for development purposes.
10
10
  *
11
11
  * Docs: https://plainkey.io/docs
12
12
  *
@@ -16,7 +16,7 @@ import { UserIdentifier } from "@plainkey/types";
16
16
  declare function usePlainKey(projectId: string, baseUrl?: string): {
17
17
  authenticate: (userIdentifier?: UserIdentifier) => Promise<_plainkey_types0.AuthenticateResult>;
18
18
  createUserWithPasskey: (userName?: string) => Promise<_plainkey_types0.CreateUserWithPasskeyResult>;
19
- addPasskey: (userToken: string, userIdentifier: UserIdentifier) => Promise<_plainkey_types0.AddPasskeyResult>;
19
+ addPasskey: (userToken: string) => Promise<_plainkey_types0.AddPasskeyResult>;
20
20
  };
21
21
  //#endregion
22
22
  export { usePlainKey };
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../src/usePlainkey/index.ts"],"sourcesContent":[],"mappings":";;;;;;;;AAaA;;;;;;;AA+BuE,iBA/BvD,WAAA,CA+BuD,SAAA,EAAA,MAAA,EAAA,OAAA,CAAA,EAAA,MAAA,CAAA,EAAA;EAAA,YAAA,EAAA,CAAA,cAAA,CAAA,EAtB9B,cAsB8B,EAAA,GAtBhB,OAsBgB,CAtBhB,gBAAA,CAAA,kBAAA,CAsBgB;EAAA,qBAAA,EAAA,CAAA,QAAA,CAAA,EAAA,MAAA,EAAA,GAZrB,OAYqB,CAtBhB,gBAAA,CAUL,2BAAA,CAYqB;kDAAd,mBAAc,QAAA,gBAAA,CAAA,gBAAA"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../src/usePlainkey/index.ts"],"sourcesContent":[],"mappings":";;;;;;;;AAaA;;;;;;;AA6BuC,iBA7BvB,WAAA,CA6BuB,SAAA,EAAA,MAAA,EAAA,OAAA,CAAA,EAAA,MAAA,CAAA,EAAA;EAAA,YAAA,EAAA,CAAA,cAAA,CAAA,EApBE,cAoBF,EAAA,GApBgB,OAoBhB,CApBgB,gBAAA,CAAA,kBAAA,CAoBhB;gDAVW,QAVK,gBAAA,CAUL,2BAAA;qCAUX,QAVW,gBAAA,CAUX,gBAAA"}
package/dist/index.js CHANGED
@@ -4,7 +4,7 @@ import { PlainKey } from "@plainkey/browser";
4
4
  /**
5
5
  *
6
6
  * @param projectId - Your PlainKey project ID. You can find it in the PlainKey admin dashboard.
7
- * @param baseUrl - Set by default to https://api.plainkey.io/api. Change only for development purposes.
7
+ * @param baseUrl - Set by default to https://api.plainkey.io/browser. Change only for development purposes.
8
8
  *
9
9
  * Docs: https://plainkey.io/docs
10
10
  *
@@ -36,11 +36,9 @@ function usePlainKey(projectId, baseUrl) {
36
36
  *
37
37
  * @param userToken - The user authentication token, obtained from login.
38
38
  * Do NOT store it in local storage, database, etc. Always keep it in memory.
39
- *
40
- * @param userIdentifier - An object with either the user's PlainKey User ID or their userName.
41
39
  */
42
- function addPasskey(userToken, userIdentifier) {
43
- return plainKey.addPasskey(userToken, userIdentifier);
40
+ function addPasskey(userToken) {
41
+ return plainKey.addPasskey(userToken);
44
42
  }
45
43
  return {
46
44
  authenticate,
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../src/usePlainkey/index.ts"],"sourcesContent":["import { PlainKey } from \"@plainkey/browser\"\nimport { UserIdentifier } from \"@plainkey/types\"\n\n/**\n *\n * @param projectId - Your PlainKey project ID. You can find it in the PlainKey admin dashboard.\n * @param baseUrl - Set by default to https://api.plainkey.io/api. Change only for development purposes.\n *\n * Docs: https://plainkey.io/docs\n *\n * @example\n * const { login, createUserWithPasskey, addPasskey } = usePlainKey(\"projectId\")\n */\nexport function usePlainKey(projectId: string, baseUrl?: string) {\n const plainKey = new PlainKey(projectId, baseUrl)\n\n /**\n * Authenticates a user. Can be used for login, verification, 2FA, etc.\n * Will require user interaction to authenticate.\n *\n * @param userIdentifier - An object with either the user's PlainKey User ID or their userName.\n */\n function authenticate(userIdentifier?: UserIdentifier) {\n return plainKey.authenticate(userIdentifier)\n }\n\n /**\n * Registration of a new user with a passkey. Will require user interaction to create a passkey.\n *\n * @param userName - A stable unique identifier for the user, like an email address or username.\n * Can be empty for usernameless login.\n */\n function createUserWithPasskey(userName?: string) {\n return plainKey.createUserWithPasskey(userName)\n }\n\n /**\n * Adds a passkey to an existing user. Will require user interaction to create a passkey.\n *\n * @param userToken - The user authentication token, obtained from login.\n * Do NOT store it in local storage, database, etc. Always keep it in memory.\n *\n * @param userIdentifier - An object with either the user's PlainKey User ID or their userName.\n */\n function addPasskey(userToken: string, userIdentifier: UserIdentifier) {\n return plainKey.addPasskey(userToken, userIdentifier)\n }\n\n return {\n authenticate,\n createUserWithPasskey,\n addPasskey\n }\n}\n"],"mappings":";;;;;;;;;;;;;AAaA,SAAgB,YAAY,WAAmB,SAAkB;CAC/D,MAAM,WAAW,IAAI,SAAS,WAAW,QAAQ;;;;;;;CAQjD,SAAS,aAAa,gBAAiC;AACrD,SAAO,SAAS,aAAa,eAAe;;;;;;;;CAS9C,SAAS,sBAAsB,UAAmB;AAChD,SAAO,SAAS,sBAAsB,SAAS;;;;;;;;;;CAWjD,SAAS,WAAW,WAAmB,gBAAgC;AACrE,SAAO,SAAS,WAAW,WAAW,eAAe;;AAGvD,QAAO;EACL;EACA;EACA;EACD"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../src/usePlainkey/index.ts"],"sourcesContent":["import { PlainKey } from \"@plainkey/browser\"\nimport type { UserIdentifier } from \"@plainkey/types\"\n\n/**\n *\n * @param projectId - Your PlainKey project ID. You can find it in the PlainKey admin dashboard.\n * @param baseUrl - Set by default to https://api.plainkey.io/browser. Change only for development purposes.\n *\n * Docs: https://plainkey.io/docs\n *\n * @example\n * const { login, createUserWithPasskey, addPasskey } = usePlainKey(\"projectId\")\n */\nexport function usePlainKey(projectId: string, baseUrl?: string) {\n const plainKey = new PlainKey(projectId, baseUrl)\n\n /**\n * Authenticates a user. Can be used for login, verification, 2FA, etc.\n * Will require user interaction to authenticate.\n *\n * @param userIdentifier - An object with either the user's PlainKey User ID or their userName.\n */\n function authenticate(userIdentifier?: UserIdentifier) {\n return plainKey.authenticate(userIdentifier)\n }\n\n /**\n * Registration of a new user with a passkey. Will require user interaction to create a passkey.\n *\n * @param userName - A stable unique identifier for the user, like an email address or username.\n * Can be empty for usernameless login.\n */\n function createUserWithPasskey(userName?: string) {\n return plainKey.createUserWithPasskey(userName)\n }\n\n /**\n * Adds a passkey to an existing user. Will require user interaction to create a passkey.\n *\n * @param userToken - The user authentication token, obtained from login.\n * Do NOT store it in local storage, database, etc. Always keep it in memory.\n */\n function addPasskey(userToken: string) {\n return plainKey.addPasskey(userToken)\n }\n\n return {\n authenticate,\n createUserWithPasskey,\n addPasskey\n }\n}\n"],"mappings":";;;;;;;;;;;;;AAaA,SAAgB,YAAY,WAAmB,SAAkB;CAC/D,MAAM,WAAW,IAAI,SAAS,WAAW,QAAQ;;;;;;;CAQjD,SAAS,aAAa,gBAAiC;AACrD,SAAO,SAAS,aAAa,eAAe;;;;;;;;CAS9C,SAAS,sBAAsB,UAAmB;AAChD,SAAO,SAAS,sBAAsB,SAAS;;;;;;;;CASjD,SAAS,WAAW,WAAmB;AACrC,SAAO,SAAS,WAAW,UAAU;;AAGvC,QAAO;EACL;EACA;EACA;EACD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plainkey/vue",
3
- "version": "0.7.0",
3
+ "version": "0.8.0",
4
4
  "description": "PlainKey Vue SDK (composable)",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",