fix: ask for client id in scripts

This commit is contained in:
lucas-neynar
2025-03-18 10:58:19 -07:00
parent a66e219438
commit 990ffe1448
5 changed files with 94 additions and 22 deletions

View File

@@ -41,7 +41,7 @@ export async function sendNeynarFrameNotification({
const notification = {
title,
body,
target_url: process.env.NEXT_PUBLIC_URL,
target_url: process.env.NEXT_PUBLIC_URL!,
};
const result = await client.publishFrameNotifications({
@@ -49,12 +49,12 @@ export async function sendNeynarFrameNotification({
notification
});
if (result.success) {
if (result.notification_deliveries.length > 0) {
return { state: "success" };
} else if (result.status === 429) {
return { state: "rate_limit" };
} else if (result.notification_deliveries.length === 0) {
return { state: "no_token" };
} else {
return { state: "error", error: result.error || "Unknown error" };
return { state: "error", error: result || "Unknown error" };
}
} catch (error) {
return { state: "error", error };