<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Dapr Cryptography JavaScript SDK on Dapr Docs</title><link>https://docs.dapr.io/developing-applications/sdks/js/js-cryptography/</link><description>Recent content in Dapr Cryptography JavaScript SDK on Dapr Docs</description><generator>Hugo</generator><language>en</language><atom:link href="https://docs.dapr.io/developing-applications/sdks/js/js-cryptography/index.xml" rel="self" type="application/rss+xml"/><item><title>How to: Encrypt and decrypt data with the Dapr JavaScript SDK</title><link>https://docs.dapr.io/developing-applications/sdks/js/js-cryptography/js-cryptography-howto/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://docs.dapr.io/developing-applications/sdks/js/js-cryptography/js-cryptography-howto/</guid><description>&lt;p>Use &lt;code>DaprClient.crypto&lt;/code> to encrypt and decrypt data without passing cryptographic keys to your application. This guide uses a local key for development, then shows how to work with buffers and files.&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> with a runtime that supports the alpha Cryptography API&lt;/li>
&lt;li>&lt;a href="https://nodejs.org/">Node.js&lt;/a> 18 or later; a supported LTS release is recommended&lt;/li>
&lt;li>The &lt;a href="https://www.npmjs.com/package/@dapr/dapr">&lt;code>@dapr/dapr&lt;/code>&lt;/a> package, &lt;strong>version 3.19.0 or later&lt;/strong>&lt;/li>
&lt;li>A configured &lt;a href="https://docs.dapr.io/reference/components-reference/supported-cryptography/">cryptography component&lt;/a> and a key compatible with the selected key-wrapping algorithm&lt;/li>
&lt;/ul>
&lt;p>In your application directory, initialize an npm project if you do not already have one, then install the SDK:&lt;/p></description></item><item><title>Cryptography client usage</title><link>https://docs.dapr.io/developing-applications/sdks/js/js-cryptography/js-cryptography-client-usage/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://docs.dapr.io/developing-applications/sdks/js/js-cryptography/js-cryptography-client-usage/</guid><description>&lt;p>Cryptography is available through &lt;code>DaprClient.crypto&lt;/code>. This page describes &lt;strong>&lt;code>@dapr/dapr&lt;/code> version 3.19.0 or later&lt;/strong>, which supports both HTTP and gRPC. Both transports use the alpha Cryptography API.&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> rather than creating one for each operation. Await outstanding operations and stream pipelines before calling &lt;code>await client.stop()&lt;/code> during application shutdown.&lt;/p>
&lt;p>HTTP is the default protocol and uses sidecar port &lt;code>&amp;quot;3500&amp;quot;&lt;/code> by default. For gRPC, configure the protocol and its port explicitly:&lt;/p></description></item></channel></rss>