mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-07 18:27:36 +00:00
Update quickstart example
This commit is contained in:
@@ -64,9 +64,9 @@ These examples demonstrate how to store and fetch environment variables from [In
|
|||||||
### Initialize the Infisical client
|
### Initialize the Infisical client
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import infisical from "infisical-node";
|
import InfisicalClient from "infisical-node";
|
||||||
|
|
||||||
infisical.connect({
|
const client = new InfisicalClient({
|
||||||
token: "your_infisical_token",
|
token: "your_infisical_token",
|
||||||
});
|
});
|
||||||
```
|
```
|
||||||
@@ -74,25 +74,25 @@ These examples demonstrate how to store and fetch environment variables from [In
|
|||||||
### Get a value
|
### Get a value
|
||||||
|
|
||||||
```js
|
```js
|
||||||
const value = await infisical.getSecret("SOME_KEY");
|
const value = await client.getSecret("SOME_KEY");
|
||||||
```
|
```
|
||||||
|
|
||||||
### Example with Express
|
### Example with Express
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import infisical from "infisical-node";
|
import InfisicalClient from "infisical-node";
|
||||||
import express from "express";
|
import express from "express";
|
||||||
const app = express();
|
const app = express();
|
||||||
const PORT = 3000;
|
const PORT = 3000;
|
||||||
|
|
||||||
await infisical.connect({
|
const client = InfisicalClient({
|
||||||
token: "st.xxx.xxx",
|
token: "st.xxx.xxx",
|
||||||
});
|
});
|
||||||
|
|
||||||
// your application logic
|
// your application logic
|
||||||
|
|
||||||
app.get("/", async (req, res) => {
|
app.get("/", async (req, res) => {
|
||||||
const name = await infisical.getSecret("NAME");
|
const name = await client.getSecret("NAME");
|
||||||
res.send(`Hello! My name is: ${name.secretValue}`);
|
res.send(`Hello! My name is: ${name.secretValue}`);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
title: "Node"
|
title: "Node"
|
||||||
---
|
---
|
||||||
|
|
||||||
If you're working with Node.js, the official [infisical-node](https://github.com/Infisical/infisical-node) package is the easiest way to fetch and work with ecrets for your application.
|
If you're working with Node.js, the official [infisical-node](https://github.com/Infisical/infisical-node) package is the easiest way to fetch and work with secrets for your application.
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user