# Sprig Cloud Mode Integration

<p>RudderStack lets you send your event data to Sprig via <a href="https://www.rudderstack.com/docs/destinations/rudderstack-connection-modes/#cloud-mode" >cloud mode</a>.</p>
<p>Find the open source code for this destination in the <a href="https://github.com/rudderlabs/rudder-transformer/tree/main/src/cdk/v2/destinations/sprig" >GitHub repository</a>.</p>
<!-- end-chunk -->
<!-- begin-chunk -->
<h2 id="identify">Identify</h2><p>You can use the <a href="https://www.rudderstack.com/docs/event-spec/standard-events/identify/" ><code>identify</code></a> call to create a user in Sprig.</p>
<p>A sample <code>identify</code> call is shown:</p>
<div class="rs-code">
  <div class="rs-code__head">javascript<button class="rs-code__copy" type="button">
      
      Copy
    </button>
  </div>
  <div class="highlight"><pre class="chroma"><code class="language-javascript" data-lang="javascript">rudderanalytics.identify(&#39;1hKOmRA4GRlm&#39;, {
  firstName: &#39;Alex&#39;,
  lastName: &#39;Keener&#39;,
  email: &#34;alex@example.com&#34;
});</code></pre></div>
</div>
<!-- end-chunk -->
<!-- begin-chunk -->
<h3 id="traits-mapping">Traits mapping</h3><p>RudderStack maps the following user attributes in the <code>identify</code> events to the corresponding Sprig fields:</p>
<table>
  <thead>
      <tr>
          <th>RudderStack property</th>
          <th>Sprig property</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td><code>userId</code> <br/> Required</td>
          <td><code>userId</code></td>
      </tr>
      <tr>
          <td><code>email</code></td>
          <td><code>emailAddress</code></td>
      </tr>
      <tr>
          <td><code>context.traits</code></td>
          <td><code>attributes</code></td>
      </tr>
  </tbody>
</table>
<!-- end-chunk -->
<!-- begin-chunk -->
<h3 id="deleting-a-user">Deleting a user</h3><p>You can delete a user in Sprig using the <a href="https://www.rudderstack.com/docs/api/user-suppression-api/#adding-a-suppression-with-delete-regulation" >Suppression with Delete regulation</a> of RudderStack&rsquo;s <a href="https://www.rudderstack.com/docs/api/user-suppression-api/" >User Suppression API</a>.</p>

<html lang="en">
<blockquote class="info">
  <div class="tip-quote">
    
    <div class="tip-text">To delete a user, you must specify their <code>userId</code> and the <a href="https://www.rudderstack.com/docs/destinations/streaming-destinations/sprig/setup/#connection-settings" >Sprig API key</a> in the event.</div>
  </div>
</blockquote>

</html>
<p>A sample regulation request body for deleting a user in Intercom is shown below:</p>
<div class="rs-code">
  <div class="rs-code__head">json<button class="rs-code__copy" type="button">
      
      Copy
    </button>
  </div>
  <div class="highlight"><pre class="chroma"><code class="language-json" data-lang="json">{
  &#34;regulationType&#34;: &#34;suppress_with_delete&#34;,
  &#34;destinationIds&#34;: [
    &#34;2FIKkByqn37FhzczP23eZmURciA&#34;
  ],
  &#34;users&#34;: [{
    &#34;userId&#34;: &#34;1hKOmRA4GRlm&#34;,
    &#34;apiKey&#34;: &#34;&lt;your_sprig_apiKey&gt;&#34;
  }]
}</code></pre></div>
</div>
<p>See the <a href="https://www.rudderstack.com/docs/dashboard-guides/destinations/#destination-details" >Destinations</a> guide for more information on obtaining the <code>destinationId</code>.</p>
<!-- end-chunk -->
<!-- begin-chunk -->
<h2 id="track">Track</h2><p>The <a href="https://www.rudderstack.com/docs/event-spec/standard-events/track/" ><code>track</code></a> call lets you record any user events along with the associated properties and send the information to Sprig.</p>
<p>A sample <code>track</code> call is shown:</p>
<div class="rs-code">
  <div class="rs-code__head">javascript<button class="rs-code__copy" type="button">
      
      Copy
    </button>
  </div>
  <div class="highlight"><pre class="chroma"><code class="language-javascript" data-lang="javascript">rudderanalytics.track(&#39;Signup&#39;, {
  firstName: &#34;Alex&#34;,
  lastName: &#34;Keener&#34;,
  email: &#34;alex@example.com&#34;
});</code></pre></div>
</div>
<!-- end-chunk -->
<!-- begin-chunk -->
<h3 id="property-mapping">Property mapping</h3><p>RudderStack maps the following event properties in the <code>track</code> events to the corresponding Sprig fields:</p>
<table>
  <thead>
      <tr>
          <th>RudderStack property</th>
          <th>Sprig property</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td><code>userId</code> <br/> Required</td>
          <td><code>userId</code></td>
      </tr>
      <tr>
          <td><code>event</code> <br/> Required</td>
          <td><code>events[0].event</code></td>
      </tr>
      <tr>
          <td><code>timestamp</code> <br/> Required</td>
          <td><code>events[0].timestamp</code></td>
      </tr>
      <tr>
          <td><code>email</code></td>
          <td><code>emailAddress</code></td>
      </tr>
  </tbody>
</table>
<br />
