Skip to content

Commit c438b72

Browse files
ci(repo): Version packages
1 parent 4a5bd7a commit c438b72

28 files changed

+126
-73
lines changed

.changeset/floppy-tigers-push.md

Lines changed: 0 additions & 40 deletions
This file was deleted.

.changeset/petite-donkeys-leave.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/purple-crabs-cheat.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/silent-women-dance.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/tiny-spoons-unite.md

Lines changed: 0 additions & 2 deletions
This file was deleted.

.changeset/wild-pots-grab.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

packages/astro/CHANGELOG.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,46 @@
11
# @clerk/astro
22

3+
## 2.12.0
4+
5+
### Minor Changes
6+
7+
- Introduces machine authentication, supporting four token types: `api_key`, `oauth_token`, `m2m_token`, and `session_token`. For backwards compatibility, `session_token` remains the default when no token type is specified. This enables machine-to-machine authentication and use cases such as API keys and OAuth integrations. Existing applications continue to work without modification. ([#6671](https://github.com/clerk/javascript/pull/6671)) by [@wobsoriano](https://github.com/wobsoriano)
8+
9+
You can specify which token types are allowed by using the `acceptsToken` option in the `auth()` local. This option can be set to a specific type, an array of types, or `'any'` to accept all supported tokens.
10+
11+
Example usage in endpoints:
12+
13+
```ts
14+
export const GET: APIRoute = ({ locals }) => {
15+
const authObject = locals.auth({ acceptsToken: 'any' });
16+
17+
if (authObject.tokenType === 'session_token') {
18+
console.log('this is session token from a user');
19+
} else {
20+
console.log('this is some other type of machine token (api_key | oauth_token | m2m_token)');
21+
console.log('more specifically, a ' + authObject.tokenType);
22+
}
23+
24+
return new Response(JSON.stringify({}));
25+
};
26+
```
27+
28+
In middleware:
29+
30+
```ts
31+
import { clerkMiddleware, createRouteMatcher } from '@clerk/astro/server';
32+
33+
const isProtectedRoute = createRouteMatcher(['/api(.*)']);
34+
35+
export const onRequest = clerkMiddleware((auth, context) => {
36+
const { userId } = auth({ acceptsToken: 'api_key' });
37+
38+
if (!userId && isProtectedRoute(context.request)) {
39+
return new Response('Unauthorized', { status: 401 });
40+
}
41+
});
42+
```
43+
344
## 2.11.11
445

546
### Patch Changes

packages/astro/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@clerk/astro",
3-
"version": "2.11.11",
3+
"version": "2.12.0",
44
"description": "Clerk SDK for Astro",
55
"keywords": [
66
"auth",

packages/chrome-extension/CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Change Log
22

3+
## 2.5.30
4+
5+
### Patch Changes
6+
7+
- Updated dependencies [[`bddb828`](https://github.com/clerk/javascript/commit/bddb82815d4dbfe574834867d66639d3e342f7f8), [`4a5bd7a`](https://github.com/clerk/javascript/commit/4a5bd7a4d9e96c89af07db69fc140ca2adb87f08)]:
8+
- @clerk/clerk-js@5.91.3
9+
- @clerk/clerk-react@5.46.2
10+
311
## 2.5.29
412

513
### Patch Changes

packages/chrome-extension/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@clerk/chrome-extension",
3-
"version": "2.5.29",
3+
"version": "2.5.30",
44
"description": "Clerk SDK for Chrome extensions",
55
"keywords": [
66
"auth",

0 commit comments

Comments
 (0)