Skip to content

Commit

Permalink
chore: update versions
Browse files Browse the repository at this point in the history
  • Loading branch information
pffigueiredo committed Oct 7, 2024
1 parent 645ff1a commit 8b4909a
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.10.1 (2024-10-07)

Fix `CONFIG.MD` documentation.

## 0.10.0 (2024-10-07)

Capture stack traces in `NeonDbError`, if `Error.captureStackTrace` is available.
Expand Down
2 changes: 1 addition & 1 deletion dist/jsr/jsr.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@neon/serverless",
"version": "0.9.5",
"version": "0.10.1",
"exports": "./index.js",
"imports": {
"pg": "npm:@types/[email protected]"
Expand Down
4 changes: 4 additions & 0 deletions dist/npm/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.10.1 (2024-10-07)

Fix `CONFIG.MD` documentation.

## 0.10.0 (2024-10-07)

Capture stack traces in `NeonDbError`, if `Error.captureStackTrace` is available.
Expand Down
16 changes: 16 additions & 0 deletions dist/npm/CONFIG.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,22 @@ const rows = await sql('SELECT * FROM posts WHERE id = $1', [postId], {
clearTimeout(timeout);
```

### `authToken: string | (() => Promise<string> | string)`

The `authToken` option can be passed to `neon(...)` to set the `Authorization` header for the `fetch` request. This allows you to authenticate database requests against third-party authentication providers. So, this mechanism can be used to ensure that access control and authorization are managed effectively across different systems.

Example of usage:

```typescript
import { neon } from '@neondatabase/serverless';
// Retrieve the JWT token (implementation depends on your auth system)
const authToken = getAuthToken();
// Initialize the Neon client with a connection string and auth token
const sql = neon(process.env.DATABASE_URL, { authToken });
// Run a query
const posts = await sql('SELECT * FROM posts');
```

## `transaction(...)` function

The `transaction(queriesOrFn, options)` function is exposed as a property on the query function. It allows multiple queries to be executed within a single, non-interactive transaction.
Expand Down
4 changes: 2 additions & 2 deletions dist/npm/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/npm/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@neondatabase/serverless",
"version": "0.9.5",
"version": "0.10.1",
"author": "Neon",
"description": "node-postgres for serverless environments from neon.tech",
"exports": {
Expand Down

0 comments on commit 8b4909a

Please sign in to comment.