Update node.mdx

This commit is contained in:
Daniel Hougaard
2025-01-25 03:59:06 +01:00
parent c7a4b6c4e9
commit b5a89edeed

View File

@@ -65,7 +65,7 @@ const setupClient = () => {
siteUrl: "your-infisical-instance.com" // Optional, defaults to https://app.infisical.com
});
await client.auth().universalAuth.login({
await infisicalSdk.auth().universalAuth.login({
clientId: "<machine-identity-client-id>",
clientSecret: "<machine-identity-client-secret>"
});
@@ -77,12 +77,12 @@ const setupClient = () => {
app.get("/", async (req, res) => {
await setupClient();
const name = await client.getSecret({
const name = await client.secrets().getSecret({
environment: "dev", // dev, staging, prod, etc.
projectId: "<project-id>",
path: "/",
secretPath: "/",
secretName: "NAME"
});
@@ -90,7 +90,8 @@ app.get("/", async (req, res) => {
});
app.listen(PORT, async () => {
// initialize http server
// initialize http server and Infisical
await setupClient();
console.log(`Server listening on port ${PORT}`);
});
```