diff --git a/README.md b/README.md index d9dcbde..f799663 100644 --- a/README.md +++ b/README.md @@ -6,9 +6,9 @@ -[![GitHub contributors](https://img.shields.io/github/contributors/base/base-skills)](https://github.com/base/base-skills/graphs/contributors) -[![GitHub commit activity](https://img.shields.io/github/commit-activity/w/base/base-skills)](https://github.com/base/base-skills/graphs/contributors) -![GitHub repo size](https://img.shields.io/github/repo-size/base/base-skills) +[![GitHub contributors](https://img.shields.io/github/contributors/base/skills)](https://github.com/base/skills/graphs/contributors) +[![GitHub commit activity](https://img.shields.io/github/commit-activity/w/base/skills)](https://github.com/base/skills/graphs/contributors) +![GitHub repo size](https://img.shields.io/github/repo-size/base/skills) @@ -20,8 +20,8 @@ -[![GitHub pull requests by-label](https://img.shields.io/github/issues-pr-raw/base/base-skills)](https://github.com/base/base-skills/pulls) -[![GitHub Issues](https://img.shields.io/github/issues-raw/base/base-skills.svg)](https://github.com/base/base-skills/issues) +[![GitHub pull requests by-label](https://img.shields.io/github/issues-pr-raw/base/skills)](https://github.com/base/skills/pulls) +[![GitHub Issues](https://img.shields.io/github/issues-raw/base/skills.svg)](https://github.com/base/skills/issues) ## Available Skills @@ -42,7 +42,7 @@ Install with [Vercel's Skills CLI](https://skills.sh): ```bash -npx skills add base/base-skills +npx skills add base/skills ``` ## Usage diff --git a/skills/converting-minikit-to-farcaster/NOTIFICATIONS.md b/skills/converting-minikit-to-farcaster/NOTIFICATIONS.md new file mode 100644 index 0000000..ea50505 --- /dev/null +++ b/skills/converting-minikit-to-farcaster/NOTIFICATIONS.md @@ -0,0 +1,54 @@ +# Notifications Migration + +MiniKit's `useNotification` hook does not have a direct one-to-one client-side replacement in the Farcaster Mini App SDK. + +When migrating notification functionality, move notification sending logic to your backend instead of sending notifications directly from the client. + +## Migration Summary + +### Before + +MiniKit apps may use `useNotification()` from `@coinbase/onchainkit/minikit` inside client components. + +### After + +Farcaster Mini Apps should trigger a backend endpoint from the client. The backend is responsible for handling notification delivery. + +## Recommended Pattern + +Create a server endpoint, such as: + +`POST /api/send-notification` + +Then call that endpoint from your client when a notification should be sent. + +Example client-side trigger: + +```typescript +async function sendNotification() { + await fetch('/api/send-notification', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + body: JSON.stringify({ + title: 'Hello!', + body: 'You have a new message', + }), + }); +} +``` + +## Important Notes + +- Do not keep notification credentials or secrets in client-side code. +- Validate the user and request on the backend before sending notifications. +- Avoid blindly forwarding arbitrary client-provided notification content. +- Treat notification sending as a server-side capability. + +## Migration Checklist + +- Remove `useNotification` imports from `@coinbase/onchainkit/minikit`. +- Replace direct client notification calls with a backend API call. +- Add backend validation before sending notifications. +- Keep any notification tokens, secrets, or credentials server-side.