Skip to content

Commit

Permalink
docs(readme): examples use ESM (#609)
Browse files Browse the repository at this point in the history
  • Loading branch information
oscard0m authored Feb 24, 2024
1 parent 517fd98 commit 10214d9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ const result = await requestWithAuth("GET /user");
For more complex authentication strategies such as GitHub Apps or Basic, we recommend the according authentication library exported by [`@octokit/auth`](https://github.com/octokit/auth.js).

```js
const { createAppAuth } = require("@octokit/auth-app");
import { createAppAuth } from "@octokit/auth-app";
const auth = createAppAuth({
appId: process.env.APP_ID,
privateKey: process.env.PRIVATE_KEY,
Expand Down Expand Up @@ -417,7 +417,8 @@ If the error is due to an `AbortSignal` being used, the resulting `AbortError` i
Override or set default options. Example:

```js
const myrequest = require("@octokit/request").defaults({
import { request } from "@octokit/request";
const myrequest = request.defaults({
baseUrl: "https://github-enterprise.acme-inc.com/api/v3",
headers: {
"user-agent": "myApp/1.2.3",
Expand Down

0 comments on commit 10214d9

Please sign in to comment.