<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Felipe Aragão</title>
    <description>The latest articles on DEV Community by Felipe Aragão (@felipap).</description>
    <link>https://dev.to/felipap</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F251517%2F58f0a203-dc34-4087-9bce-8432a2fe1e4f.jpeg</url>
      <title>DEV Community: Felipe Aragão</title>
      <link>https://dev.to/felipap</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/felipap"/>
    <language>en</language>
    <item>
      <title>Handshake: Next.js boilerplate for OAuth with 200+ APIs</title>
      <dc:creator>Felipe Aragão</dc:creator>
      <pubDate>Wed, 28 Feb 2024 21:39:15 +0000</pubDate>
      <link>https://dev.to/felipap/handshake-nextjs-boilerplate-for-oauth-with-200-apis-k84</link>
      <guid>https://dev.to/felipap/handshake-nextjs-boilerplate-for-oauth-with-200-apis-k84</guid>
      <description>&lt;p&gt;Today, we're excited to announce Handshake.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/fiberinc/handshake"&gt;Handshake&lt;/a&gt; is a new open-source project that helps developers obtain access tokens to popular APIs. It abstracts away the complexities of OAuth for over 200 apps while giving teams the flexibility and observability they need.&lt;/p&gt;

&lt;h2&gt;
  
  
  How it works
&lt;/h2&gt;

&lt;p&gt;Handshake is a Next.js app that you can set up and deploy to Vercel within minutes. Just clone our repo and modify the &lt;code&gt;app/options.ts&lt;/code&gt; file to configure the OAuth providers you need.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// app/options.ts&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;Salesforce&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;HandshakeOptions&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;handshake&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;options&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;HandshakeOptions&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// ...&lt;/span&gt;
    &lt;span class="na"&gt;handlers&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
        &lt;span class="nc"&gt;Salesforce&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
            &lt;span class="na"&gt;clientId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;YOUR_CLIENT_ID&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="na"&gt;clientSecret&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;YOUR_CLIENT_SECRET&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="na"&gt;scopes&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[...]&lt;/span&gt;
        &lt;span class="p"&gt;})&lt;/span&gt;
    &lt;span class="p"&gt;],&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nx"&gt;options&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then, deploy your Handshake instance to a subdomain such as &lt;code&gt;handshake.yourdomain.com&lt;/code&gt;. Finally, to request access tokens for an API (eg. Salesforce) from a user, redirect them to &lt;code&gt;/auth/salesforce/redirect&lt;/code&gt; and let Handshake handle the rest.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why we built this
&lt;/h2&gt;

&lt;p&gt;Our goal at Fiber is to help developers build delightful integrations. To that end, we've been handling OAuth for some clients since our very first week as a company. As of today, we've taken thousands of end users through the process, and learned quite a bit on the way. Handshake is the product of that learning.&lt;/p&gt;

&lt;p&gt;We didn't originally plan on offering something like Handshake. Personally, I didn't believe the pain was big enough to justify our attention. So we continued to handle OAuth for some clients as an bonus feature, without advertising it anywhere.&lt;/p&gt;

&lt;p&gt;As time went on, we noticed a good amount of inbound interest in Fiber came from companies only looking for help with OAuth. Whenever we politely turned away these customers, we tried to point them towards good open-source solutions but couldn't find anything worth recommending. The projects we found usually fell into two categories: &lt;em&gt;stale&lt;/em&gt; or &lt;em&gt;bloated&lt;/em&gt;. The latter included projects that had moved beyond handling OAuth to incorporate lots of extra integration features. In the process, they lost flexibility and harmed developer experience.&lt;/p&gt;

&lt;h2&gt;
  
  
  Our plan
&lt;/h2&gt;

&lt;p&gt;Our plan for Handshake is this to &lt;strong&gt;keep it open&lt;/strong&gt; and to &lt;strong&gt;keep it simple.&lt;/strong&gt; The goal is to help developers get access to their users' third-party accounts. We won't try to pack unrelated features into it, or offer an enterprise version to make money. (&lt;a href="https://fiber.dev"&gt;Fiber&lt;/a&gt; is how we make money ;).&lt;/p&gt;

&lt;p&gt;That's it. We hope Handshake is useful to you. We're committed to keeping improving this project around for years to come.&lt;/p&gt;

&lt;p&gt;Check out our documentation at &lt;a href="https://handshake.cool"&gt;handshake.cook&lt;/a&gt; and &lt;a href="https://github.com/fiberinc/handshake"&gt;take us for a spin on Github&lt;/a&gt;. We'll love to hear your thoughts.&lt;/p&gt;

</description>
      <category>nextjs</category>
      <category>opensource</category>
      <category>javascript</category>
    </item>
  </channel>
</rss>
