@logto/next 1.0.0-beta.13 → 1.0.0-beta.15

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/README.md CHANGED
@@ -3,9 +3,9 @@
3
3
  [![Build Status](https://github.com/logto-io/js/actions/workflows/main.yml/badge.svg)](https://github.com/logto-io/js/actions/workflows/main.yml)
4
4
  [![Codecov](https://img.shields.io/codecov/c/github/logto-io/js)](https://app.codecov.io/gh/logto-io/js?branch=master)
5
5
 
6
- The Logto Next.js SDK written in TypeScript. Check out our [integration guide](https://docs.logto.io/docs/recipes/integrate-logto/next) or [docs](https://docs.logto.io/sdk/JavaScript/next/) for more information.
6
+ The Logto Next.js SDK written in TypeScript. Check out our [integration guide](https://docs.logto.io/docs/recipes/integrate-logto/next-js) or [docs](https://docs.logto.io/sdk/JavaScript/next/) for more information.
7
7
 
8
- We also provide [集成指南](https://docs.logto.io/zh-cn/docs/recipes/integrate-logto/next/) and [文档](https://docs.logto.io/zh-cn/sdk/JavaScript/next/) in Simplified Chinese.
8
+ We also provide [集成指南](https://docs.logto.io/zh-cn/docs/recipes/integrate-logto/next-js/) and [文档](https://docs.logto.io/zh-cn/sdk/JavaScript/next/) in Simplified Chinese.
9
9
 
10
10
  ## Installation
11
11
 
@@ -33,7 +33,7 @@ A sample project can be found at [Next.js Sample](https://github.com/logto-io/js
33
33
 
34
34
  Check out the source code and try it with ease.
35
35
 
36
- ```
36
+ ```bash
37
37
  pnpm i && pnpm start
38
38
  ```
39
39
 
@@ -0,0 +1,30 @@
1
+ import { LogtoConfig, GetContextParameters } from "@logto/node";
2
+ import { GetServerSidePropsContext, GetServerSidePropsResult, NextApiHandler } from "next";
3
+ declare module 'iron-session' {
4
+ interface IronSessionData {
5
+ accessToken?: string;
6
+ idToken?: string;
7
+ signInSession?: string;
8
+ refreshToken?: string;
9
+ }
10
+ }
11
+ type LogtoNextConfig = LogtoConfig & {
12
+ cookieSecret: string;
13
+ cookieSecure: boolean;
14
+ baseUrl: string;
15
+ };
16
+ export { ReservedScope, UserScope } from '@logto/node';
17
+ export type { LogtoContext } from '@logto/node';
18
+ export default class LogtoClient {
19
+ constructor(config: LogtoNextConfig);
20
+ handleSignIn: (redirectUri?: string) => NextApiHandler;
21
+ handleSignInCallback: (redirectTo?: string) => NextApiHandler;
22
+ handleSignOut: (redirectUri?: string) => NextApiHandler;
23
+ handleUser: (configs?: GetContextParameters) => NextApiHandler<any>;
24
+ handleAuthRoutes: (configs?: GetContextParameters) => NextApiHandler;
25
+ withLogtoApiRoute: (handler: NextApiHandler, config?: GetContextParameters) => NextApiHandler;
26
+ withLogtoSsr: <P extends Record<string, unknown> = Record<string, unknown>>(handler: (context: GetServerSidePropsContext) => GetServerSidePropsResult<P> | Promise<GetServerSidePropsResult<P>>, configs?: GetContextParameters) => (context: GetServerSidePropsContext<import("querystring").ParsedUrlQuery, import("next").PreviewData>) => Promise<GetServerSidePropsResult<P>>;
27
+ private get ironSessionConfigs();
28
+ }
29
+
30
+ //# sourceMappingURL=index.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@logto/next",
3
- "version": "1.0.0-beta.13",
3
+ "version": "1.0.0-beta.15",
4
4
  "source": "./src/index.ts",
5
5
  "main": "./lib/index.js",
6
6
  "exports": {
@@ -22,14 +22,14 @@
22
22
  "dev:tsc": "tsc -p tsconfig.build.json -w --preserveWatchOutput",
23
23
  "precommit": "lint-staged",
24
24
  "check": "tsc --noEmit",
25
- "build": "rm -rf lib/ && pnpm check && parcel build",
25
+ "build": "rm -rf lib/ && pnpm check && parcel build && cp lib/index.d.ts lib/module.d.mts",
26
26
  "lint": "eslint --ext .ts src",
27
27
  "test": "jest",
28
28
  "test:coverage": "jest --silent --coverage",
29
29
  "prepack": "pnpm test"
30
30
  },
31
31
  "dependencies": {
32
- "@logto/node": "^1.0.0-beta.13",
32
+ "@logto/node": "^1.0.0-beta.15",
33
33
  "iron-session": "^6.1.3"
34
34
  },
35
35
  "devDependencies": {
@@ -73,5 +73,5 @@
73
73
  }
74
74
  }
75
75
  },
76
- "gitHead": "8c64e263617689191d60391021f5f1b0872ff276"
76
+ "gitHead": "4dcfacd4a1b5d5fa5c7c83edb34c591fab2a8f44"
77
77
  }