sdk-javascript/index.html

274 lines
32 KiB
HTML

<!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>cloudevents</title><meta name="description" content="Documentation for cloudevents"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="assets/style.css"/><link rel="stylesheet" href="assets/highlight.css"/><script async src="assets/search.js" id="search-script"></script></head><body><script>document.body.classList.add(localStorage.getItem("tsd-theme") || "os")</script><header><div class="tsd-page-toolbar"><div class="container"><div class="table-wrap"><div class="table-cell" id="tsd-search" data-base="."><div class="field"><label for="tsd-search-field" class="tsd-widget search no-caption">Search</label><input type="text" id="tsd-search-field"/></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="index.html" class="title">cloudevents</a></div><div class="table-cell" id="tsd-widgets"><div id="tsd-filter"><a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a><div class="tsd-filter-group"><div class="tsd-select" id="tsd-filter-visibility"><span class="tsd-select-label">All</span><ul class="tsd-select-list"><li data-value="public">Public</li><li data-value="protected">Public/Protected</li><li data-value="private" class="selected">All</li></ul></div> <input type="checkbox" id="tsd-filter-inherited" checked/><label class="tsd-widget" for="tsd-filter-inherited">Inherited</label><input type="checkbox" id="tsd-filter-externals" checked/><label class="tsd-widget" for="tsd-filter-externals">Externals</label></div></div><a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a></div></div></div></div><div class="tsd-page-title"><div class="container"><h1>cloudevents </h1></div></div></header><div class="container container-main"><div class="row"><div class="col-8 col-content"><div class="tsd-panel tsd-typography">
<a href="#javascript-sdk-for-cloudevents" id="javascript-sdk-for-cloudevents" style="color: inherit; text-decoration: none;">
<h1>JavaScript SDK for CloudEvents</h1>
</a>
<p><a href="https://www.codacy.com/gh/cloudevents/sdk-javascript/dashboard?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=cloudevents/sdk-javascript&amp;utm_campaign=Badge_Grade"><img src="https://app.codacy.com/project/badge/Grade/2e29a55fb4084ecca4642d72dc4c83d4" alt="Codacy Badge"></a>
<a href="https://www.codacy.com/gh/cloudevents/sdk-javascript/dashboard?utm_source=github.com&utm_medium=referral&utm_content=cloudevents/sdk-javascript&utm_campaign=Badge_Coverage"><img src="https://app.codacy.com/project/badge/Coverage/2e29a55fb4084ecca4642d72dc4c83d4" alt="Codacy Badge"></a>
<img src="https://github.com/cloudevents/sdk-javascript/workflows/Node.js%20CI/badge.svg" alt="Node.js CI">
<a href="https://www.npmjs.com/package/cloudevents"><img src="https://img.shields.io/npm/v/cloudevents.svg" alt="npm version"></a>
<a href="https://snyk.io/test/github/cloudevents/sdk-javascript"><img src="https://snyk.io/test/github/cloudevents/sdk-javascript/badge.svg" alt="vulnerabilities"></a></p>
<p>The CloudEvents SDK for JavaScript.</p>
<a href="#features" id="features" style="color: inherit; text-decoration: none;">
<h2>Features</h2>
</a>
<ul>
<li>Represent CloudEvents in memory</li>
<li>Serialize and deserialize CloudEvents in different <a href="https://github.com/cloudevents/spec/blob/v1.0/spec.md#event-format">event formats</a>.</li>
<li>Send and receive CloudEvents with via different <a href="https://github.com/cloudevents/spec/blob/v1.0/spec.md#protocol-binding">protocol bindings</a>.</li>
</ul>
<p><em>Note:</em> Supports CloudEvent version 1.0</p>
<a href="#installation" id="installation" style="color: inherit; text-decoration: none;">
<h2>Installation</h2>
</a>
<p>The CloudEvents SDK requires a current LTS version of Node.js. At the moment
those are Node.js 16.x, and Node.js 18.x. To install in your Node.js project:</p>
<pre><code class="language-console">npm install cloudevents
</code></pre>
<a href="#receiving-and-emitting-events" id="receiving-and-emitting-events" style="color: inherit; text-decoration: none;">
<h3>Receiving and Emitting Events</h3>
</a>
<a href="#receiving-events" id="receiving-events" style="color: inherit; text-decoration: none;">
<h4>Receiving Events</h4>
</a>
<p>You can choose any popular web framework for port binding. A <code>CloudEvent</code>
object can be created by simply providing the <code>HTTP</code> protocol binding
the incoming headers and request body.</p>
<pre><code class="language-js"><span class="hl-0">const</span><span class="hl-1"> </span><span class="hl-2">app</span><span class="hl-1"> = </span><span class="hl-3">require</span><span class="hl-1">(</span><span class="hl-4">&quot;express&quot;</span><span class="hl-1">)();</span><br/><span class="hl-0">const</span><span class="hl-1"> { </span><span class="hl-2">HTTP</span><span class="hl-1"> } = </span><span class="hl-3">require</span><span class="hl-1">(</span><span class="hl-4">&quot;cloudevents&quot;</span><span class="hl-1">);</span><br/><br/><span class="hl-5">app</span><span class="hl-1">.</span><span class="hl-3">post</span><span class="hl-1">(</span><span class="hl-4">&quot;/&quot;</span><span class="hl-1">, (</span><span class="hl-5">req</span><span class="hl-1">, </span><span class="hl-5">res</span><span class="hl-1">) </span><span class="hl-0">=&gt;</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-6">// body and headers come from an incoming HTTP request, e.g. express.js</span><br/><span class="hl-1"> </span><span class="hl-0">const</span><span class="hl-1"> </span><span class="hl-2">receivedEvent</span><span class="hl-1"> = </span><span class="hl-2">HTTP</span><span class="hl-1">.</span><span class="hl-3">toEvent</span><span class="hl-1">({ </span><span class="hl-5">headers:</span><span class="hl-1"> </span><span class="hl-5">req</span><span class="hl-1">.</span><span class="hl-5">headers</span><span class="hl-1">, </span><span class="hl-5">body:</span><span class="hl-1"> </span><span class="hl-5">req</span><span class="hl-1">.</span><span class="hl-5">body</span><span class="hl-1"> });</span><br/><span class="hl-1"> </span><span class="hl-5">console</span><span class="hl-1">.</span><span class="hl-3">log</span><span class="hl-1">(</span><span class="hl-5">receivedEvent</span><span class="hl-1">);</span><br/><span class="hl-1">});</span>
</code></pre>
<a href="#emitting-events" id="emitting-events" style="color: inherit; text-decoration: none;">
<h4>Emitting Events</h4>
</a>
<p>The easiest way to send events is to use the built-in HTTP emitter.</p>
<pre><code class="language-js"><span class="hl-0">const</span><span class="hl-1"> { </span><span class="hl-2">httpTransport</span><span class="hl-1">, </span><span class="hl-2">emitterFor</span><span class="hl-1">, </span><span class="hl-2">CloudEvent</span><span class="hl-1"> } = </span><span class="hl-3">require</span><span class="hl-1">(</span><span class="hl-4">&quot;cloudevents&quot;</span><span class="hl-1">);</span><br/><br/><span class="hl-6">// Create an emitter to send events to a receiver</span><br/><span class="hl-0">const</span><span class="hl-1"> </span><span class="hl-2">emit</span><span class="hl-1"> = </span><span class="hl-3">emitterFor</span><span class="hl-1">(</span><span class="hl-3">httpTransport</span><span class="hl-1">(</span><span class="hl-4">&quot;https://my.receiver.com/endpoint&quot;</span><span class="hl-1">));</span><br/><br/><span class="hl-6">// Create a new CloudEvent</span><br/><span class="hl-0">const</span><span class="hl-1"> </span><span class="hl-2">ce</span><span class="hl-1"> = </span><span class="hl-0">new</span><span class="hl-1"> </span><span class="hl-3">CloudEvent</span><span class="hl-1">({ </span><span class="hl-5">type</span><span class="hl-1">, </span><span class="hl-5">source</span><span class="hl-1">, </span><span class="hl-5">data</span><span class="hl-1"> });</span><br/><br/><span class="hl-6">// Send it to the endpoint - encoded as HTTP binary by default</span><br/><span class="hl-3">emit</span><span class="hl-1">(</span><span class="hl-5">ce</span><span class="hl-1">);</span>
</code></pre>
<p>If you prefer to use another transport mechanism for sending events
over HTTP, you can use the <code>HTTP</code> binding to create a <code>Message</code> which
has properties for <code>headers</code> and <code>body</code>, allowing greater flexibility
and customization. For example, the <code>axios</code> module is used here to send
a CloudEvent.</p>
<pre><code class="language-js"><span class="hl-0">const</span><span class="hl-1"> </span><span class="hl-2">axios</span><span class="hl-1"> = </span><span class="hl-3">require</span><span class="hl-1">(</span><span class="hl-4">&quot;axios&quot;</span><span class="hl-1">).</span><span class="hl-5">default</span><span class="hl-1">;</span><br/><span class="hl-0">const</span><span class="hl-1"> { </span><span class="hl-2">HTTP</span><span class="hl-1">, </span><span class="hl-2">CloudEvent</span><span class="hl-1"> } = </span><span class="hl-3">require</span><span class="hl-1">(</span><span class="hl-4">&quot;cloudevents&quot;</span><span class="hl-1">);</span><br/><br/><span class="hl-0">const</span><span class="hl-1"> </span><span class="hl-2">ce</span><span class="hl-1"> = </span><span class="hl-0">new</span><span class="hl-1"> </span><span class="hl-3">CloudEvent</span><span class="hl-1">({ </span><span class="hl-5">type</span><span class="hl-1">, </span><span class="hl-5">source</span><span class="hl-1">, </span><span class="hl-5">data</span><span class="hl-1"> });</span><br/><span class="hl-0">const</span><span class="hl-1"> </span><span class="hl-2">message</span><span class="hl-1"> = </span><span class="hl-2">HTTP</span><span class="hl-1">.</span><span class="hl-3">binary</span><span class="hl-1">(</span><span class="hl-5">ce</span><span class="hl-1">); </span><span class="hl-6">// Or HTTP.structured(ce)</span><br/><br/><span class="hl-3">axios</span><span class="hl-1">({</span><br/><span class="hl-1"> </span><span class="hl-5">method:</span><span class="hl-1"> </span><span class="hl-4">&quot;post&quot;</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-5">url:</span><span class="hl-1"> </span><span class="hl-4">&quot;...&quot;</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-5">data:</span><span class="hl-1"> </span><span class="hl-5">message</span><span class="hl-1">.</span><span class="hl-5">body</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-5">headers:</span><span class="hl-1"> </span><span class="hl-5">message</span><span class="hl-1">.</span><span class="hl-5">headers</span><span class="hl-1">,</span><br/><span class="hl-1">});</span>
</code></pre>
<p>You may also use the <code>emitterFor()</code> function as a convenience.</p>
<pre><code class="language-js"><span class="hl-0">const</span><span class="hl-1"> </span><span class="hl-2">axios</span><span class="hl-1"> = </span><span class="hl-3">require</span><span class="hl-1">(</span><span class="hl-4">&quot;axios&quot;</span><span class="hl-1">).</span><span class="hl-5">default</span><span class="hl-1">;</span><br/><span class="hl-0">const</span><span class="hl-1"> { </span><span class="hl-2">emitterFor</span><span class="hl-1">, </span><span class="hl-2">Mode</span><span class="hl-1">, </span><span class="hl-2">CloudEvent</span><span class="hl-1"> } = </span><span class="hl-3">require</span><span class="hl-1">(</span><span class="hl-4">&quot;cloudevents&quot;</span><span class="hl-1">);</span><br/><br/><span class="hl-0">function</span><span class="hl-1"> </span><span class="hl-3">sendWithAxios</span><span class="hl-1">(</span><span class="hl-5">message</span><span class="hl-1">) {</span><br/><span class="hl-1"> </span><span class="hl-6">// Do what you need with the message headers</span><br/><span class="hl-1"> </span><span class="hl-6">// and body in this function, then send the</span><br/><span class="hl-1"> </span><span class="hl-6">// event</span><br/><span class="hl-1"> </span><span class="hl-3">axios</span><span class="hl-1">({</span><br/><span class="hl-1"> </span><span class="hl-5">method:</span><span class="hl-1"> </span><span class="hl-4">&quot;post&quot;</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-5">url:</span><span class="hl-1"> </span><span class="hl-4">&quot;...&quot;</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-5">data:</span><span class="hl-1"> </span><span class="hl-5">message</span><span class="hl-1">.</span><span class="hl-5">body</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-5">headers:</span><span class="hl-1"> </span><span class="hl-5">message</span><span class="hl-1">.</span><span class="hl-5">headers</span><span class="hl-1">,</span><br/><span class="hl-1"> });</span><br/><span class="hl-1">}</span><br/><br/><span class="hl-0">const</span><span class="hl-1"> </span><span class="hl-2">emit</span><span class="hl-1"> = </span><span class="hl-3">emitterFor</span><span class="hl-1">(</span><span class="hl-5">sendWithAxios</span><span class="hl-1">, { </span><span class="hl-5">mode:</span><span class="hl-1"> </span><span class="hl-5">Mode</span><span class="hl-1">.</span><span class="hl-2">BINARY</span><span class="hl-1"> });</span><br/><span class="hl-3">emit</span><span class="hl-1">(</span><span class="hl-0">new</span><span class="hl-1"> </span><span class="hl-3">CloudEvent</span><span class="hl-1">({ </span><span class="hl-5">type</span><span class="hl-1">, </span><span class="hl-5">source</span><span class="hl-1">, </span><span class="hl-5">data</span><span class="hl-1"> }));</span>
</code></pre>
<p>You may also use the <code>Emitter</code> singleton to send your <code>CloudEvents</code>.</p>
<pre><code class="language-js"><span class="hl-0">const</span><span class="hl-1"> { </span><span class="hl-2">emitterFor</span><span class="hl-1">, </span><span class="hl-2">httpTransport</span><span class="hl-1">, </span><span class="hl-2">Mode</span><span class="hl-1">, </span><span class="hl-2">CloudEvent</span><span class="hl-1">, </span><span class="hl-2">Emitter</span><span class="hl-1"> } = </span><span class="hl-3">require</span><span class="hl-1">(</span><span class="hl-4">&quot;cloudevents&quot;</span><span class="hl-1">);</span><br/><br/><span class="hl-6">// Create a CloudEvent emitter function to send events to our receiver</span><br/><span class="hl-0">const</span><span class="hl-1"> </span><span class="hl-2">emit</span><span class="hl-1"> = </span><span class="hl-3">emitterFor</span><span class="hl-1">(</span><span class="hl-3">httpTransport</span><span class="hl-1">(</span><span class="hl-4">&quot;https://example.com/receiver&quot;</span><span class="hl-1">));</span><br/><br/><span class="hl-6">// Use the emit() function to send a CloudEvent to its endpoint when a &quot;cloudevent&quot; event is emitted</span><br/><span class="hl-6">// (see: https://nodejs.org/api/events.html#class-eventemitter)</span><br/><span class="hl-5">Emitter</span><span class="hl-1">.</span><span class="hl-3">on</span><span class="hl-1">(</span><span class="hl-4">&quot;cloudevent&quot;</span><span class="hl-1">, </span><span class="hl-5">emit</span><span class="hl-1">);</span><br/><br/><span class="hl-1">...</span><br/><span class="hl-6">// In any part of the code, calling `emit()` on a `CloudEvent` instance will send the event</span><br/><span class="hl-0">new</span><span class="hl-1"> </span><span class="hl-3">CloudEvent</span><span class="hl-1">({ </span><span class="hl-5">type</span><span class="hl-1">, </span><span class="hl-5">source</span><span class="hl-1">, </span><span class="hl-5">data</span><span class="hl-1"> }).</span><span class="hl-3">emit</span><span class="hl-1">();</span><br/><br/><span class="hl-6">// You can also have several listeners to send the event to several endpoints</span>
</code></pre>
<a href="#cloudevent-objects" id="cloudevent-objects" style="color: inherit; text-decoration: none;">
<h2>CloudEvent Objects</h2>
</a>
<p>All created <code>CloudEvent</code> objects are read-only. If you need to update a property or add a new extension to an existing cloud event object, you can use the <code>cloneWith</code> method. This will return a new <code>CloudEvent</code> with any update or new properties. For example:</p>
<pre><code class="language-js"><span class="hl-0">const</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-2">CloudEvent</span><span class="hl-1">,</span><br/><span class="hl-1">} = </span><span class="hl-3">require</span><span class="hl-1">(</span><span class="hl-4">&quot;cloudevents&quot;</span><span class="hl-1">);</span><br/><br/><span class="hl-6">// Create a new CloudEvent</span><br/><span class="hl-0">const</span><span class="hl-1"> </span><span class="hl-2">ce</span><span class="hl-1"> = </span><span class="hl-0">new</span><span class="hl-1"> </span><span class="hl-3">CloudEvent</span><span class="hl-1">({...});</span><br/><br/><span class="hl-6">// Add a new extension to an existing CloudEvent</span><br/><span class="hl-0">const</span><span class="hl-1"> </span><span class="hl-2">ce2</span><span class="hl-1"> = </span><span class="hl-5">ce</span><span class="hl-1">.</span><span class="hl-3">cloneWith</span><span class="hl-1">({</span><span class="hl-5">extension:</span><span class="hl-1"> </span><span class="hl-4">&quot;Value&quot;</span><span class="hl-1">});</span>
</code></pre>
<p>You can create a <code>CloudEvent</code> object in many ways, for example, in TypeScript:</p>
<pre><code class="language-ts"><span class="hl-7">import</span><span class="hl-1"> { </span><span class="hl-5">CloudEvent</span><span class="hl-1">, </span><span class="hl-5">CloudEventV1</span><span class="hl-1">, </span><span class="hl-5">CloudEventV1Attributes</span><span class="hl-1"> } </span><span class="hl-7">from</span><span class="hl-1"> </span><span class="hl-4">&quot;cloudevents&quot;</span><span class="hl-1">;</span><br/><span class="hl-0">const</span><span class="hl-1"> </span><span class="hl-2">ce</span><span class="hl-1">: </span><span class="hl-8">CloudEventV1</span><span class="hl-1">&lt;</span><span class="hl-8">string</span><span class="hl-1">&gt; = {</span><br/><span class="hl-1"> </span><span class="hl-5">specversion:</span><span class="hl-1"> </span><span class="hl-4">&quot;1.0&quot;</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-5">source:</span><span class="hl-1"> </span><span class="hl-4">&quot;/some/source&quot;</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-5">type:</span><span class="hl-1"> </span><span class="hl-4">&quot;example&quot;</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-5">id:</span><span class="hl-1"> </span><span class="hl-4">&quot;1234&quot;</span><br/><span class="hl-1">};</span><br/><span class="hl-0">const</span><span class="hl-1"> </span><span class="hl-2">event</span><span class="hl-1"> = </span><span class="hl-0">new</span><span class="hl-1"> </span><span class="hl-3">CloudEvent</span><span class="hl-1">(</span><span class="hl-5">ce</span><span class="hl-1">);</span><br/><span class="hl-0">const</span><span class="hl-1"> </span><span class="hl-2">ce2</span><span class="hl-1">: </span><span class="hl-8">CloudEventV1Attributes</span><span class="hl-1">&lt;</span><span class="hl-8">string</span><span class="hl-1">&gt; = {</span><br/><span class="hl-1"> </span><span class="hl-5">specversion:</span><span class="hl-1"> </span><span class="hl-4">&quot;1.0&quot;</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-5">source:</span><span class="hl-1"> </span><span class="hl-4">&quot;/some/source&quot;</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-5">type:</span><span class="hl-1"> </span><span class="hl-4">&quot;example&quot;</span><span class="hl-1">,</span><br/><span class="hl-1">};</span><br/><span class="hl-0">const</span><span class="hl-1"> </span><span class="hl-2">event2</span><span class="hl-1"> = </span><span class="hl-0">new</span><span class="hl-1"> </span><span class="hl-3">CloudEvent</span><span class="hl-1">(</span><span class="hl-5">ce2</span><span class="hl-1">);</span><br/><span class="hl-0">const</span><span class="hl-1"> </span><span class="hl-2">event3</span><span class="hl-1"> = </span><span class="hl-0">new</span><span class="hl-1"> </span><span class="hl-3">CloudEvent</span><span class="hl-1">({</span><br/><span class="hl-1"> </span><span class="hl-5">source:</span><span class="hl-1"> </span><span class="hl-4">&quot;/some/source&quot;</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-5">type:</span><span class="hl-1"> </span><span class="hl-4">&quot;example&quot;</span><span class="hl-1">,</span><br/><span class="hl-1">});</span>
</code></pre>
<a href="#a-note-about-big-integers" id="a-note-about-big-integers" style="color: inherit; text-decoration: none;">
<h3>A Note About Big Integers</h3>
</a>
<p>When parsing JSON data, if a JSON field value is a number, and that number
is really big, JavaScript loses precision. For example, the Twitter API exposes
the Tweet ID. This is a large number that exceeds the integer space of <code>Number</code>.</p>
<p>In order to address this situation, you can set the environment variable
<code>CE_USE_BIG_INT</code> to the string value <code>&quot;true&quot;</code> to enable the use of the
<a href="https://www.npmjs.com/package/json-bigint"><code>json-bigint</code></a> package. This
package is not used by default due to the resulting slowdown in parse speed
by a factor of 7x.</p>
<p>See for more information: <a href="https://github.com/cloudevents/sdk-javascript/issues/489">https://github.com/cloudevents/sdk-javascript/issues/489</a></p>
<a href="#example-applications" id="example-applications" style="color: inherit; text-decoration: none;">
<h3>Example Applications</h3>
</a>
<p>There are a few trivial example applications in
<a href="https://github.com/cloudevents/sdk-javascript/tree/main/examples">the examples folder</a>.
There you will find Express.js, TypeScript and Websocket examples.</p>
<a href="#api-transition-guide" id="api-transition-guide" style="color: inherit; text-decoration: none;">
<h3>API Transition Guide</h3>
</a>
<p><a href="./API_TRANSITION_GUIDE.md">Guide Link</a></p>
<a href="#supported-specification-features" id="supported-specification-features" style="color: inherit; text-decoration: none;">
<h2>Supported specification features</h2>
</a>
<table>
<thead>
<tr>
<th>Core Specification</th>
<th><a href="https://github.com/cloudevents/spec/blob/v0.3/spec.md">v0.3</a></th>
<th><a href="https://github.com/cloudevents/spec/blob/v1.0/spec.md">v1.0</a></th>
</tr>
</thead>
<tbody><tr>
<td>CloudEvents Core</td>
<td>:white_check_mark:</td>
<td>:white_check_mark:</td>
</tr>
</tbody></table>
<hr>
<table>
<thead>
<tr>
<th>Event Formats</th>
<th><a href="https://github.com/cloudevents/spec/tree/v0.3">v0.3</a></th>
<th><a href="https://github.com/cloudevents/spec/blob/v1.0/spec.md#event-format">v1.0</a></th>
</tr>
</thead>
<tbody><tr>
<td>AVRO Event Format</td>
<td>:x:</td>
<td>:x:</td>
</tr>
<tr>
<td>JSON Event Format</td>
<td>:white_check_mark:</td>
<td>:white_check_mark:</td>
</tr>
</tbody></table>
<hr>
<table>
<thead>
<tr>
<th>Protocol Bindings</th>
<th><a href="https://github.com/cloudevents/spec/tree/v0.3">v0.3</a></th>
<th><a href="https://github.com/cloudevents/spec/blob/v1.0/spec.md#protocol-binding">v1.0</a></th>
</tr>
</thead>
<tbody><tr>
<td>AMQP Protocol Binding</td>
<td>:x:</td>
<td>:x:</td>
</tr>
<tr>
<td>HTTP Protocol Binding</td>
<td>:white_check_mark:</td>
<td>:white_check_mark:</td>
</tr>
<tr>
<td>Kafka Protocol Binding</td>
<td>:x:</td>
<td>:white_check_mark:</td>
</tr>
<tr>
<td>MQTT Protocol Binding</td>
<td>:white_check_mark:</td>
<td>:x:</td>
</tr>
<tr>
<td>NATS Protocol Binding</td>
<td>:x:</td>
<td>:x:</td>
</tr>
</tbody></table>
<hr>
<table>
<thead>
<tr>
<th>Content Modes</th>
<th><a href="https://github.com/cloudevents/spec/tree/v0.3">v0.3</a></th>
<th><a href="https://github.com/cloudevents/spec/blob/v1.0/http-protocol-binding.md#13-content-modes">v1.0</a></th>
</tr>
</thead>
<tbody><tr>
<td>HTTP Binary</td>
<td>:white_check_mark:</td>
<td>:white_check_mark:</td>
</tr>
<tr>
<td>HTTP Structured</td>
<td>:white_check_mark:</td>
<td>:white_check_mark:</td>
</tr>
<tr>
<td>HTTP Batch</td>
<td>:white_check_mark:</td>
<td>:white_check_mark:</td>
</tr>
<tr>
<td>Kafka Binary</td>
<td>:white_check_mark:</td>
<td>:white_check_mark:</td>
</tr>
<tr>
<td>Kafka Structured</td>
<td>:white_check_mark:</td>
<td>:white_check_mark:</td>
</tr>
<tr>
<td>Kafka Batch</td>
<td>:white_check_mark:</td>
<td>:white_check_mark:</td>
</tr>
<tr>
<td>MQTT Binary</td>
<td>:white_check_mark:</td>
<td>:white_check_mark:</td>
</tr>
<tr>
<td>MQTT Structured</td>
<td>:white_check_mark:</td>
<td>:white_check_mark:</td>
</tr>
</tbody></table>
<a href="#community" id="community" style="color: inherit; text-decoration: none;">
<h2>Community</h2>
</a>
<ul>
<li>There are bi-weekly calls immediately following the <a href="https://github.com/cloudevents/spec#meeting-time">Serverless/CloudEvents
call</a> at
9am PT (US Pacific). Which means they will typically start at 10am PT, but
if the other call ends early then the SDK call will start early as well.
See the <a href="https://docs.google.com/document/d/1OVF68rpuPK5shIHILK9JOqlZBbfe91RNzQ7u_P7YCDE/edit#">CloudEvents meeting minutes</a>
to determine which week will have the call.</li>
<li>Slack: #cloudeventssdk channel under
<a href="https://slack.cncf.io/">CNCF&#39;s Slack workspace</a>.</li>
<li>Email: <a href="https://lists.cncf.io/g/cncf-cloudevents-sdk">https://lists.cncf.io/g/cncf-cloudevents-sdk</a></li>
</ul>
<a href="#maintainers" id="maintainers" style="color: inherit; text-decoration: none;">
<h2>Maintainers</h2>
</a>
<p>Currently active maintainers who may be found in the CNCF Slack.</p>
<ul>
<li>Lance Ball (@lance)</li>
<li>Lucas Holmquist (@lholmquist)</li>
</ul>
<a href="#contributing" id="contributing" style="color: inherit; text-decoration: none;">
<h2>Contributing</h2>
</a>
<p>We love contributions from the community! Please check the
<a href="https://github.com/cloudevents/sdk-javascript/blob/main/CONTRIBUTING.md">Contributor&#39;s Guide</a>
for information on how to get involved.</p>
<p>Each SDK may have its own unique processes, tooling and guidelines, common
governance related material can be found in the
<a href="https://github.com/cloudevents/spec/tree/master/community">CloudEvents <code>community</code></a>
directory. In particular, in there you will find information concerning
how SDK projects are
<a href="https://github.com/cloudevents/spec/blob/master/community/SDK-GOVERNANCE.md">managed</a>,
<a href="https://github.com/cloudevents/spec/blob/master/community/SDK-maintainer-guidelines.md">guidelines</a>
for how PR reviews and approval, and our
<a href="https://github.com/cloudevents/spec/blob/master/community/GOVERNANCE.md#additional-information">Code of Conduct</a>
information.</p>
<p>If there is a security concern with one of the CloudEvents specifications, or
with one of the project&#39;s SDKs, please send an email to
<a href="mailto:cncf-cloudevents-security@lists.cncf.io">cncf-cloudevents-security@lists.cncf.io</a>.</p>
<a href="#additional-sdk-resources" id="additional-sdk-resources" style="color: inherit; text-decoration: none;">
<h2>Additional SDK Resources</h2>
</a>
<ul>
<li><a href="MAINTAINERS.md">List of current active maintainers</a></li>
<li><a href="CONTRIBUTING.md">How to contribute to the project</a></li>
<li><a href="LICENSE">SDK&#39;s License</a></li>
<li><a href="RELEASING.md">SDK&#39;s Release process</a></li>
</ul>
</div></div><div class="col-4 col-menu menu-sticky-wrap menu-highlight"><nav class="tsd-navigation primary"><ul><li class="current"><a href="modules.html">Exports</a></li></ul></nav><nav class="tsd-navigation secondary menu-sticky"><ul><li class="tsd-kind-enum"><a href="enums/Mode.html" class="tsd-kind-icon">Mode</a></li><li class="tsd-kind-class tsd-has-type-parameter"><a href="classes/CloudEvent.html" class="tsd-kind-icon">Cloud<wbr/>Event</a></li><li class="tsd-kind-class"><a href="classes/Emitter.html" class="tsd-kind-icon">Emitter</a></li><li class="tsd-kind-class"><a href="classes/ValidationError.html" class="tsd-kind-icon">Validation<wbr/>Error</a></li><li class="tsd-kind-interface tsd-has-type-parameter"><a href="interfaces/Binding.html" class="tsd-kind-icon">Binding</a></li><li class="tsd-kind-interface tsd-has-type-parameter"><a href="interfaces/CloudEventV1.html" class="tsd-kind-icon">Cloud<wbr/>Event<wbr/>V1</a></li><li class="tsd-kind-interface tsd-has-type-parameter"><a href="interfaces/Deserializer.html" class="tsd-kind-icon">Deserializer</a></li><li class="tsd-kind-interface tsd-has-type-parameter"><a href="interfaces/EmitterFunction.html" class="tsd-kind-icon">Emitter<wbr/>Function</a></li><li class="tsd-kind-interface"><a href="interfaces/Headers.html" class="tsd-kind-icon">Headers</a></li><li class="tsd-kind-interface tsd-has-type-parameter"><a href="interfaces/KafkaEvent.html" class="tsd-kind-icon">Kafka<wbr/>Event</a></li><li class="tsd-kind-interface tsd-has-type-parameter"><a href="interfaces/KafkaMessage.html" class="tsd-kind-icon">Kafka<wbr/>Message</a></li><li class="tsd-kind-interface tsd-has-type-parameter"><a href="interfaces/MQTTMessage.html" class="tsd-kind-icon">MQTTMessage</a></li><li class="tsd-kind-interface tsd-has-type-parameter"><a href="interfaces/Message.html" class="tsd-kind-icon">Message</a></li><li class="tsd-kind-interface"><a href="interfaces/Options.html" class="tsd-kind-icon">Options</a></li><li class="tsd-kind-interface tsd-has-type-parameter"><a href="interfaces/Serializer.html" class="tsd-kind-icon">Serializer</a></li><li class="tsd-kind-interface"><a href="interfaces/TransportFunction.html" class="tsd-kind-icon">Transport<wbr/>Function</a></li><li class="tsd-kind-variable"><a href="modules.html#HTTP" class="tsd-kind-icon">HTTP</a></li><li class="tsd-kind-variable"><a href="modules.html#Kafka" class="tsd-kind-icon">Kafka</a></li><li class="tsd-kind-variable"><a href="modules.html#MQTT" class="tsd-kind-icon">MQTT</a></li><li class="tsd-kind-variable"><a href="modules.html#V1" class="tsd-kind-icon">V1</a></li><li class="tsd-kind-function tsd-has-type-parameter"><a href="modules.html#MQTTMessageFactory" class="tsd-kind-icon">MQTTMessage<wbr/>Factory</a></li><li class="tsd-kind-function"><a href="modules.html#emitterFor" class="tsd-kind-icon">emitter<wbr/>For</a></li><li class="tsd-kind-function"><a href="modules.html#httpTransport" class="tsd-kind-icon">http<wbr/>Transport</a></li></ul></nav></div></div></div><footer class="with-border-bottom"><div class="container"><h2>Legend</h2><div class="tsd-legend-group"><ul class="tsd-legend"><li class="tsd-kind-constructor tsd-parent-kind-class"><span class="tsd-kind-icon">Constructor</span></li><li class="tsd-kind-property tsd-parent-kind-class"><span class="tsd-kind-icon">Property</span></li><li class="tsd-kind-method tsd-parent-kind-class"><span class="tsd-kind-icon">Method</span></li></ul><ul class="tsd-legend"><li class="tsd-kind-property tsd-parent-kind-class tsd-is-static"><span class="tsd-kind-icon">Static property</span></li><li class="tsd-kind-method tsd-parent-kind-class tsd-is-static"><span class="tsd-kind-icon">Static method</span></li></ul><ul class="tsd-legend"><li class="tsd-kind-property tsd-parent-kind-interface"><span class="tsd-kind-icon">Property</span></li></ul></div><h2>Settings</h2><p>Theme <select id="theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></p></div></footer><div class="container tsd-generator"><p>Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></div><div class="overlay"></div><script src="assets/main.js"></script></body></html>