<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Dapr Secrets JavaScript SDK on Dapr Docs</title><link>https://docs.dapr.io/developing-applications/sdks/js/js-secrets/</link><description>Recent content in Dapr Secrets JavaScript SDK on Dapr Docs</description><generator>Hugo</generator><language>en</language><atom:link href="https://docs.dapr.io/developing-applications/sdks/js/js-secrets/index.xml" rel="self" type="application/rss+xml"/><item><title>How to: Retrieve secrets with the Dapr JavaScript SDK</title><link>https://docs.dapr.io/developing-applications/sdks/js/js-secrets/js-secrets-howto/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://docs.dapr.io/developing-applications/sdks/js/js-secrets/js-secrets-howto/</guid><description>&lt;p>This guide uses &lt;code>DaprClient.secret&lt;/code> to retrieve a single secret and all accessible secrets from a local secret store. The examples use JavaScript ES modules; the same methods are available in TypeScript.&lt;/p>
&lt;h2 id="prerequisites">Prerequisites&lt;/h2>
&lt;ul>
&lt;li>&lt;a href="https://docs.dapr.io/getting-started/install-dapr-cli/">Dapr CLI&lt;/a>&lt;/li>
&lt;li>An initialized &lt;a href="https://docs.dapr.io/getting-started/install-dapr-selfhost/">Dapr environment&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://nodejs.org/">Node.js&lt;/a> 18 or later&lt;/li>
&lt;li>The &lt;a href="https://www.npmjs.com/package/@dapr/dapr">&lt;code>@dapr/dapr&lt;/code>&lt;/a> package, version 3.19.0 or later&lt;/li>
&lt;/ul>
&lt;p>In your application directory, initialize an npm project if needed and install the SDK:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-sh" data-lang="sh">&lt;span class="line">&lt;span class="cl">npm init -y
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">npm install @dapr/dapr@3.19.0
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>The explicit version ensures that npm installs the 3.19.0 release used in this guide. You can substitute a later version.&lt;/p></description></item><item><title>Secrets client usage</title><link>https://docs.dapr.io/developing-applications/sdks/js/js-secrets/js-secrets-client-usage/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://docs.dapr.io/developing-applications/sdks/js/js-secrets/js-secrets-client-usage/</guid><description>&lt;p>Secrets are available through &lt;code>DaprClient.secret&lt;/code>; there is no separate secrets client package or builder. This guidance targets &lt;code>@dapr/dapr&lt;/code> 3.19.0 or later.&lt;/p>
&lt;h2 id="client-lifetime-and-configuration">Client lifetime and configuration&lt;/h2>
&lt;p>Reuse a long-lived &lt;code>DaprClient&lt;/code> across operations. Its secrets client shares the parent client&amp;rsquo;s connection and authentication settings. Await outstanding operations before calling &lt;code>await client.stop()&lt;/code> during application shutdown; do not stop a shared client after each secret lookup.&lt;/p>
&lt;p>HTTP is the default protocol. To explicitly configure gRPC:&lt;/p></description></item></channel></rss>