This example shows how to use the ODD SDK with Passkeys authentication to build a simple Photo Gallery app.
It uses vite
, preact
, preact-router
, @oddjs/odd
, @oddjs/preact
and @oddjs/passkeys
.
You can use Codesandbox and start hacking right away.
To clone it locally:
npx tiged oddsdk/passkeys/examples/odd-passkeys-preact odd-passkeys-preact
cd odd-passkeys-preact
pnpm install
pnpm dev
Open src/app.jsx
and change the config
object to match your app's namespace.
/** @type {import('@oddjs/odd')} */
const config = {
namespace: {
creator: document.location.host,
name: 'Passkey auth',
},
}
An ODD application can be published to IPFS with the Fission CLI or the Fission GitHub publish action.
To publish with the Fission CLI:
-
Run
fission setup
to make a Fission account -
Run
pnpm run build
to build the app -
Run
fission app register
to register a new Fission app (set your build directory todist
)fission app register --build-dir ./dist --name <your-app-name>
-
Run
fission app publish
to publish your app to the web
Your app will be available online at the domain assigned by the register command.
To set up the GitHub publish action:
- Register the app with the CLI
- Export your machine key with
base64 ~/.config/fission/key/machine_id.ed25519
- Add your machine key as a GH Repository secret named
FISSION_MACHINE_KEY
- Update the
publish.yml
with the name of your registered app
See the Fission Guide and the publish action README for more details.