better-near-auth 0.1.0 → 0.1.1

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 (3) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +7 -4
  3. package/package.json +2 -2
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Elliot Braem
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 CHANGED
@@ -13,7 +13,7 @@
13
13
 
14
14
  </div>
15
15
 
16
- This [Better Auth](https://better-auth.com) plugin enables secure authentication via NEAR wallets and keypairs by following the [NEP-413 standard](https://github.com/near/NEPs/blob/master/neps/nep-0413.md). It leverages [near-sign-verify](https://github.com/elliotBraem/near-sign-verify) and [fastintear](https://github.com/elliotBraem/fastintear), and provides a complete drop-in solution with secure defaults and automatic profile integration.
16
+ This [Better Auth](https://better-auth.com) plugin enables secure authentication via NEAR wallets and keypairs by following the [NEP-413 standard](https://github.com/near/NEPs/blob/master/neps/nep-0413.md). It leverages [near-sign-verify](https://github.com/elliotBraem/near-sign-verify) and [fastintear](https://github.com/elliotBraem/fastintear), and provides a complete drop-in solution with session management, secure defaults, and automatic profile integration.
17
17
 
18
18
  ## Installation
19
19
 
@@ -30,6 +30,9 @@ npm install better-near-auth
30
30
  import { siwn } from "better-near-auth";
31
31
 
32
32
  export const auth = betterAuth({
33
+ database: drizzleAdapter(db, {
34
+ // db configuration
35
+ }),
33
36
  plugins: [
34
37
  siwn({
35
38
  recipient: "myapp.com",
@@ -39,7 +42,7 @@ npm install better-near-auth
39
42
  });
40
43
  ```
41
44
 
42
- 3. Migrate the database. Run the migration or generate the schema to add the necessary fields and tables to the database.
45
+ 3. Generate the schema to add the necessary fields and tables to the database.
43
46
 
44
47
  ```bash
45
48
  npx @better-auth/cli generate
@@ -85,11 +88,11 @@ Access user profiles from NEAR Social automatically:
85
88
 
86
89
  ```ts title="profile-usage.ts"
87
90
  // Get current user's profile (requires authentication)
88
- const { data: myProfile } = await authClient.near.getProfile();
91
+ const myProfile = await authClient.near.getProfile();
89
92
  console.log("My profile:", myProfile);
90
93
 
91
94
  // Get specific user's profile (no auth required)
92
- const { data: aliceProfile } = await authClient.near.getProfile("alice.near");
95
+ const aliceProfile = await authClient.near.getProfile("alice.near");
93
96
  console.log("Alice's profile:", aliceProfile);
94
97
  ```
95
98
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "better-near-auth",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Sign in with NEAR (SIWN) plugin for Better Auth",
5
5
  "main": "index.ts",
6
6
  "module": "index.ts",
@@ -45,7 +45,7 @@
45
45
  "dependencies": {
46
46
  "@better-auth/utils": "^0.2.6",
47
47
  "@fastnear/utils": "^0.9.7",
48
- "fastintear": "link:fastintear",
48
+ "fastintear": "^0.2.3",
49
49
  "near-sign-verify": "^0.4.3",
50
50
  "zod": "^4.0.17"
51
51
  },