Skip to content

Commit bfb6577

Browse files
committed
docs: update license information across multiple README files
1 parent 3cad7fb commit bfb6577

File tree

10 files changed

+26
-996
lines changed

10 files changed

+26
-996
lines changed

packages/browser/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,4 @@ authClient.signOut();
4545

4646
## License
4747

48-
Apache-2.0
48+
Licenses this source under the Apache License, Version 2.0 [LICENSE](./LICENSE), You may not use this file except in compliance with the License.

packages/express/README.md

Lines changed: 1 addition & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -21,52 +21,6 @@ pnpm add @asgardeo/express
2121
yarn add @asgardeo/express
2222
```
2323

24-
## Quick Start
25-
26-
```javascript
27-
import { AsgardeoExpressClient } from "@asgardeo/express";
28-
29-
// Initialize the client
30-
const authClient = new AsgardeoExpressClient({
31-
clientId: "<your_client_id>",
32-
clientSecret: "<your_client_secret>",
33-
baseUrl: "https://api.asgardeo.io/t/<org_name>",
34-
callbackURL: "http://localhost:3000/callback"
35-
});
36-
37-
// Example Express.js integration
38-
import express from "express";
39-
const app = express();
40-
41-
// Login endpoint
42-
app.get("/login", (req, res) => {
43-
const authUrl = authClient.getSignInUrl();
44-
res.redirect(authUrl);
45-
});
46-
47-
// Callback handler
48-
app.get("/callback", async (req, res) => {
49-
try {
50-
const { code } = req.query;
51-
const tokens = await authClient.exchangeAuthorizationCode(code);
52-
// Store tokens and redirect to home page
53-
res.redirect("/");
54-
} catch (error) {
55-
res.status(500).send("Authentication failed");
56-
}
57-
});
58-
59-
// Get user info
60-
app.get("/userinfo", async (req, res) => {
61-
try {
62-
const userInfo = await authClient.getUserInfo();
63-
res.json(userInfo);
64-
} catch (error) {
65-
res.status(401).send("Unauthorized");
66-
}
67-
});
68-
```
69-
7024
## License
7125

72-
Apache-2.0
26+
Licenses this source under the Apache License, Version 2.0 [LICENSE](./LICENSE), You may not use this file except in compliance with the License.

packages/javascript/README.md

Lines changed: 5 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -8,50 +8,11 @@
88
<a href="./LICENSE"><img src="https://img.shields.io/badge/License-Apache%202.0-blue.svg" alt="License"></a>
99
</div>
1010

11-
## Installation
12-
13-
```bash
14-
# Using npm
15-
npm install @asgardeo/javascript
16-
17-
# or using pnpm
18-
pnpm add @asgardeo/javascript
19-
20-
# or using yarn
21-
yarn add @asgardeo/javascript
22-
```
23-
24-
## Quick Start
25-
26-
```javascript
27-
import { AsgardeoAuth } from "@asgardeo/javascript";
28-
29-
// Initialize the auth instance
30-
const auth = new AsgardeoAuth({
31-
afterSignInUrl: "https://localhost:3000",
32-
clientId: "<your_client_id>",
33-
baseUrl: "https://api.asgardeo.io/t/<org_name>"
34-
});
35-
36-
// Handle authentication
37-
auth.signIn()
38-
.then(() => {
39-
// Handle successful sign in
40-
})
41-
.catch((error) => {
42-
// Handle sign in error
43-
});
44-
45-
// Get authenticated user
46-
auth.getUser()
47-
.then((userInfo) => {
48-
console.log(userInfo);
49-
});
50-
51-
// Sign out
52-
auth.signOut();
53-
```
11+
> [!IMPORTANT]
12+
> ⚠️ Do not directly use this in your applications.
13+
> `@asgardeo/javascript` is a framework agnostic SDK that provides core authentication functionalities.
14+
> For framework-specific integrations, consider using the dedicated SDKs such as `@asgardeo/react`, `@asgardeo/next`, etc.
5415
5516
## License
5617

57-
Apache-2.0
18+
Licenses this source under the Apache License, Version 2.0 [LICENSE](./LICENSE), You may not use this file except in compliance with the License.

packages/nextjs/README.md

Lines changed: 4 additions & 130 deletions
Original file line numberDiff line numberDiff line change
@@ -8,140 +8,14 @@
88
<a href="./LICENSE"><img src="https://img.shields.io/badge/License-Apache%202.0-blue.svg" alt="License"></a>
99
</div>
1010

11-
## Installation
12-
13-
```bash
14-
# Using npm
15-
npm install @asgardeo/nextjs
16-
17-
# or using pnpm
18-
pnpm add @asgardeo/nextjs
19-
20-
# or using yarn
21-
yarn add @asgardeo/nextjs
22-
```
23-
2411
## Quick Start
2512

26-
### Option 1: Provider-based Configuration (Recommended)
27-
28-
1. Create a `.env.local` file with your Asgardeo configuration:
29-
30-
```bash
31-
NEXT_PUBLIC_ASGARDEO_BASE_URL=https://api.asgardeo.io/t/<your-organization-name>
32-
NEXT_PUBLIC_ASGARDEO_CLIENT_ID=<your-client-id>
33-
NEXT_PUBLIC_ASGARDEO_CLIENT_SECRET=<your-client-secret>
34-
```
35-
36-
2. Add the `AsgardeoProvider` to your root layout with configuration:
37-
38-
```tsx
39-
// app/layout.tsx
40-
import { AsgardeoProvider } from '@asgardeo/nextjs';
41-
42-
export default function RootLayout({ children }: { children: React.ReactNode }) {
43-
const asgardeoConfig = {
44-
baseUrl: process.env.NEXT_PUBLIC_ASGARDEO_BASE_URL,
45-
clientId: process.env.NEXT_PUBLIC_ASGARDEO_CLIENT_ID,
46-
clientSecret: process.env.NEXT_PUBLIC_ASGARDEO_CLIENT_SECRET,
47-
afterSignInUrl: process.env.NEXT_PUBLIC_ASGARDEO_AFTER_SIGN_IN_URL || 'http://localhost:3000',
48-
};
49-
50-
return (
51-
<html lang="en">
52-
<body>
53-
<AsgardeoProvider config={asgardeoConfig}>
54-
{children}
55-
</AsgardeoProvider>
56-
</body>
57-
</html>
58-
);
59-
}
60-
```
61-
62-
3. Create a simple `middleware.ts` file in your project root:
63-
64-
```typescript
65-
import { asgardeoMiddleware } from '@asgardeo/nextjs/middleware';
66-
67-
export default asgardeoMiddleware;
68-
69-
export const config = {
70-
matcher: [
71-
// Skip Next.js internals and all static files, unless found in search params
72-
'/((?!_next|[^?]*\\.(?:html?|css|js(?!on)|jpe?g|webp|png|gif|svg|ttf|woff2?|ico|csv|docx?|xlsx?|zip|webmanifest)).*)',
73-
// Always run for API routes
74-
'/(api|trpc)(.*)',
75-
],
76-
};
77-
```
78-
79-
### Option 2: Middleware-based Configuration
80-
81-
2. Then create a `middleware.ts` file in your project root to handle authentication:
82-
83-
```typescript
84-
import { createAsgardeoMiddleware } from '@asgardeo/nextjs/middleware';
85-
86-
const middleware = createAsgardeoMiddleware({
87-
baseUrl: process.env.NEXT_PUBLIC_ASGARDEO_BASE_URL,
88-
clientId: process.env.NEXT_PUBLIC_ASGARDEO_CLIENT_ID,
89-
clientSecret: process.env.NEXT_PUBLIC_ASGARDEO_CLIENT_SECRET,
90-
afterSignInUrl: 'http://localhost:3000',
91-
});
92-
93-
export { middleware };
94-
95-
export const config = {
96-
matcher: [
97-
'/((?!_next|[^?]*\\.(?:html?|css|js(?!on)|jpe?g|webp|png|gif|svg|ttf|woff2?|ico|csv|docx?|xlsx?|zip|webmanifest)).*)',
98-
'/(api|trpc)(.*)',
99-
],
100-
};
101-
```
102-
103-
3. Add `SignInButton` and `SignOutButton` buttons to your app
104-
105-
```tsx
106-
import styles from './page.module.css';
107-
import {SignInButton, SignedIn, SignOutButton, SignedOut} from '@asgardeo/nextjs';
108-
109-
export default function Home() {
110-
return (
111-
<div className={styles.page}>
112-
<main className={styles.main}>
113-
<div className={styles.ctas}>
114-
<SignedOut>
115-
<SignInButton className={styles.primary}>Sign In</SignInButton>
116-
</SignedOut>
117-
<SignedIn>
118-
<SignOutButton className={styles.secondary}>Sign Out</SignOutButton>
119-
</SignedIn>
120-
</div>
121-
</main>
122-
</div>
123-
);
124-
}
125-
```
126-
127-
## Server-side Usage
128-
129-
You can access the Asgardeo client instance in server actions and other server-side code:
130-
131-
```typescript
132-
import { getAsgardeoClient } from '@asgardeo/nextjs/server';
133-
134-
export async function getUserProfile() {
135-
const client = getAsgardeoClient();
136-
const user = await client.getUser();
137-
return user;
138-
}
139-
```
13+
Get started with Asgardeo in your Next.js application in minutes. Follow our [Next.js Quick Start Guide](https://wso2.com/asgardeo/docs/quick-starts/nextjs/) for step-by-step instructions on integrating authentication into your app.
14014

141-
## Architecture
15+
## API Documentation
14216

143-
The SDK uses a singleton pattern for the `AsgardeoNextClient` to ensure consistent authentication state across your application. The client is automatically initialized when you provide configuration through the `AsgardeoProvider` or through the middleware configuration.
17+
For complete API documentation including all components, hooks, and customization options, see the [Next.js SDK Documentation](https://wso2.com/asgardeo/docs/sdks/nextjs/overview).
14418

14519
## License
14620

147-
Apache-2.0
21+
Licenses this source under the Apache License, Version 2.0 [LICENSE](./LICENSE), You may not use this file except in compliance with the License.

packages/node/README.md

Lines changed: 5 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -8,65 +8,11 @@
88
<a href="./LICENSE"><img src="https://img.shields.io/badge/License-Apache%202.0-blue.svg" alt="License"></a>
99
</div>
1010

11-
## Installation
12-
13-
```bash
14-
# Using npm
15-
npm install @asgardeo/node
16-
17-
# or using pnpm
18-
pnpm add @asgardeo/node
19-
20-
# or using yarn
21-
yarn add @asgardeo/node
22-
```
23-
24-
## Quick Start
25-
26-
```javascript
27-
import { AsgardeoNodeClient } from "@asgardeo/node";
28-
29-
// Initialize the client
30-
const authClient = new AsgardeoNodeClient({
31-
clientId: "<your_client_id>",
32-
clientSecret: "<your_client_secret>",
33-
baseUrl: "https://api.asgardeo.io/t/<org_name>",
34-
callbackURL: "http://localhost:3000/callback"
35-
});
36-
37-
// Example Express.js integration
38-
import express from "express";
39-
const app = express();
40-
41-
// Login endpoint
42-
app.get("/login", (req, res) => {
43-
const authUrl = authClient.getSignInUrl();
44-
res.redirect(authUrl);
45-
});
46-
47-
// Callback handler
48-
app.get("/callback", async (req, res) => {
49-
try {
50-
const { code } = req.query;
51-
const tokens = await authClient.exchangeAuthorizationCode(code);
52-
// Store tokens and redirect to home page
53-
res.redirect("/");
54-
} catch (error) {
55-
res.status(500).send("Authentication failed");
56-
}
57-
});
58-
59-
// Get user info
60-
app.get("/userinfo", async (req, res) => {
61-
try {
62-
const userInfo = await authClient.getUserInfo();
63-
res.json(userInfo);
64-
} catch (error) {
65-
res.status(401).send("Unauthorized");
66-
}
67-
});
68-
```
11+
> [!IMPORTANT]
12+
> ⚠️ Do not directly use this in your applications.
13+
> `@asgardeo/node` is a framework agnostic SDK that provides core authentication functionalities.
14+
> For framework-specific integrations, consider using the dedicated SDKs such as `@asgardeo/express`, etc.
6915
7016
## License
7117

72-
Apache-2.0
18+
Licenses this source under the Apache License, Version 2.0 [LICENSE](./LICENSE), You may not use this file except in compliance with the License.

packages/nuxt/README.md

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,6 @@
88
<a href="./LICENSE"><img src="https://img.shields.io/badge/License-Apache%202.0-blue.svg" alt="License"></a>
99
</div>
1010

11-
## Installation
12-
13-
```bash
14-
# Using npm
15-
npm install @asgardeo/nuxt
16-
17-
# or using pnpm
18-
pnpm add @asgardeo/nuxt
19-
20-
# or using yarn
21-
yarn add @asgardeo/nuxt
22-
```
23-
2411
## License
2512

26-
Apache-2.0
13+
Licenses this source under the Apache License, Version 2.0 [LICENSE](./LICENSE), You may not use this file except in compliance with the License.

0 commit comments

Comments
 (0)