@shopify/react-csrf-universal-provider

A self-serializing/deserializing CSRF token provider that works for isomorphic applications

Usage no npm install needed!

<script type="module">
  import shopifyReactCsrfUniversalProvider from 'https://cdn.skypack.dev/@shopify/react-csrf-universal-provider';
</script>

README

@shopify/react-csrf-universal-provider

Build Status Build Status License: MIT npm version npm bundle size (minified + gzip)

A self-serializing/deserializing CSRF token provider that works for isomorphic applications.

Installation

$ yarn add @shopify/react-csrf-universal-provider

Usage

// App.tsx

import {CsrfUniversalProvider} from '@shopify/react-csrf-universal-provider';

function App({token}: {token?: string}) {
  return (
    <CsrfUniversalProvider value={token}>
      {/* rest of the app */}
    </CsrfUniversalProvider>
  );
}