@kimjay112/cipherwire-react
v0.1.0
Published
React bindings for Cipherwire: encrypted fetch, provider/hooks and an axios interceptor.
Maintainers
Readme
@kimjay112/cipherwire-react
import { CipherwireProvider, useCipherwire, useCipherQuery, attachCipherwire } from '@kimjay112/cipherwire-react';
<CipherwireProvider publicKey="cw_pk_…" baseUrl="https://api.example.com">
<App />
</CipherwireProvider>
const api = useCipherwire(); // { get, post, put, patch, delete, fetch }
const { data, loading, error, refetch } = useCipherQuery('/me');
// axios
attachCipherwire(axiosInstance, { publicKey: 'cw_pk_…' });Works with the Next.js App Router (the exports are client components).
