알림 유형 선택하기
| 경험 알림 | 계정 알림 | |
|---|---|---|
| 대상 | 경험에 액세스할 수 있는 사용자 | 계정의 팀 멤버 |
| 적합한 용도 | 고객 대상 앱(알림, 소셜, 피트니스) | 대시보드 앱(관리 작업, 보고서, 알림) |
| 필수 키 필드 | experience_id | account_id |
| 특정 사용자로 필터링 | user_ids(경험 액세스 권한 필요) | user_ids(팀 멤버여야 함) |
알림을 보내려면
notification:create 권한이 필요합니다. 권한 가이드에서 추가하세요. 경험이 앱에 속해 있거나, 계정에 앱이 설치되어 있어야 합니다.경험의 모든 사용자에게 보내기
경험에 액세스할 수 있는 모든 사용자에게 알림을 보내세요:const result = await client.notifications.create({
experience_id: 'exp_xxxxxxxxxxxxxx',
title: 'New Feature Available',
subtitle: 'Check it out now',
content: 'We just released a new feature that helps you track your progress better.',
});
console.log(result.success); // true
result = client.notifications.create(
experience_id="exp_xxxxxxxxxxxxxx",
title="New Feature Available",
subtitle="Check it out now",
content="We just released a new feature that helps you track your progress better.",
)
print(result.success) # True
result = client.notifications.create(
experience_id: "exp_xxxxxxxxxxxxxx",
title: "New Feature Available",
subtitle: "Check it out now",
content: "We just released a new feature that helps you track your progress better."
)
puts result.success # true
let result = client
.notifications
.create(
&CreateNotificationsRequest {
experience_id: Some("exp_xxxxxxxxxxxxxx".to_string()),
title: "New Feature Available".to_string(),
subtitle: Some("Check it out now".to_string()),
content: "We just released a new feature that helps you track your progress better."
.to_string(),
..Default::default()
},
None,
)
.await?;
println!("{}", result.success); // true
result, err := client.Notifications.Create(context.TODO(), &whopsdk.CreateNotificationsRequest{
ExperienceID: whopsdk.String("exp_xxxxxxxxxxxxxx"),
Title: "New Feature Available",
Subtitle: whopsdk.String("Check it out now"),
Content: "We just released a new feature that helps you track your progress better.",
})
if err != nil {
log.Fatal(err)
}
fmt.Println(result.Success) // true
사용 사례 예시: 피트니스 추적 앱을 만든다면 새 운동 프로그램이 출시될 때
모든 사용자에게 알림을 보낼 수 있습니다. 또한 7일 연속 기록을 달성한 사용자에게
성취를 축하하는 맞춤 알림을 보낼 수도 있습니다.
특정 사용자에게 보내기
user_ids 매개변수를 사용하여 특정 사용자에게만 알림을 보내세요. 이 사용자들도 경험에 액세스할 수 있어야 합니다.
const result = await client.notifications.create({
experience_id: 'exp_xxxxxxxxxxxxxx',
title: 'Complete your daily workout',
content: 'You\'re 50% of the way to your goal. Finish strong!',
user_ids: ['user_abc123', 'user_def456'],
});
result = client.notifications.create(
experience_id="exp_xxxxxxxxxxxxxx",
title="Complete your daily workout",
content="You're 50% of the way to your goal. Finish strong!",
user_ids=["user_abc123", "user_def456"],
)
result = client.notifications.create(
experience_id: "exp_xxxxxxxxxxxxxx",
title: "Complete your daily workout",
content: "You're 50% of the way to your goal. Finish strong!",
user_ids: ["user_abc123", "user_def456"]
)
client
.notifications
.create(
&CreateNotificationsRequest {
experience_id: Some("exp_xxxxxxxxxxxxxx".to_string()),
title: "Complete your daily workout".to_string(),
content: "You're 50% of the way to your goal. Finish strong!".to_string(),
user_ids: Some(vec!["user_abc123".to_string(), "user_def456".to_string()]),
..Default::default()
},
None,
)
.await?;
_, err := client.Notifications.Create(context.TODO(), &whopsdk.CreateNotificationsRequest{
ExperienceID: whopsdk.String("exp_xxxxxxxxxxxxxx"),
Title: "Complete your daily workout",
Content: "You're 50% of the way to your goal. Finish strong!",
UserIDs: []string{"user_abc123", "user_def456"},
})
if err != nil {
log.Fatal(err)
}
계정 팀 멤버에게 보내기
계정의 모든 팀 멤버(대시보드 앱 사용자)에게 알림을 보내세요:const result = await client.notifications.create({
account_id: 'biz_xxxxxxxxxxxxxx',
title: 'Monthly Report Ready',
subtitle: 'October 2024',
content: 'Your monthly analytics report has been generated and is ready to view.',
});
result = client.notifications.create(
account_id="biz_xxxxxxxxxxxxxx",
title="Monthly Report Ready",
subtitle="October 2024",
content="Your monthly analytics report has been generated and is ready to view.",
)
result = client.notifications.create(
account_id: "biz_xxxxxxxxxxxxxx",
title: "Monthly Report Ready",
subtitle: "October 2024",
content: "Your monthly analytics report has been generated and is ready to view."
)
let result = client
.notifications
.create(
&CreateNotificationsRequest {
account_id: Some("biz_xxxxxxxxxxxxxx".to_string()),
title: "Monthly Report Ready".to_string(),
subtitle: Some("October 2024".to_string()),
content: "Your monthly analytics report has been generated and is ready to view."
.to_string(),
..Default::default()
},
None,
)
.await?;
_, err := client.Notifications.Create(context.TODO(), &whopsdk.CreateNotificationsRequest{
AccountID: whopsdk.String("biz_xxxxxxxxxxxxxx"),
Title: "Monthly Report Ready",
Subtitle: whopsdk.String("October 2024"),
Content: "Your monthly analytics report has been generated and is ready to view.",
})
if err != nil {
log.Fatal(err)
}
사용 사례 예시: 세금 신고 대시보드를 만든다면 신고 마감일이 다가올 때
모든 팀 멤버에게 알림을 보낼 수 있습니다. 또한 신고 절차의 단계를 아직
완료하지 않은 특정 사용자에게 맞춤 리마인더를 보낼 수도 있습니다.
특정 팀 멤버에게 보내기
user_ids 매개변수를 사용하여 특정 팀 멤버에게만 알림을 보내세요. 이 사용자들도 계정의 팀 멤버여야 합니다.
const result = await client.notifications.create({
account_id: 'biz_xxxxxxxxxxxxxx',
title: 'Action Required',
content: 'Please review and approve the pending invoices.',
user_ids: ['user_manager1', 'user_manager2'],
});
result = client.notifications.create(
account_id="biz_xxxxxxxxxxxxxx",
title="Action Required",
content="Please review and approve the pending invoices.",
user_ids=["user_manager1", "user_manager2"],
)
result = client.notifications.create(
account_id: "biz_xxxxxxxxxxxxxx",
title: "Action Required",
content: "Please review and approve the pending invoices.",
user_ids: ["user_manager1", "user_manager2"]
)
client
.notifications
.create(
&CreateNotificationsRequest {
account_id: Some("biz_xxxxxxxxxxxxxx".to_string()),
title: "Action Required".to_string(),
content: "Please review and approve the pending invoices.".to_string(),
user_ids: Some(vec!["user_manager1".to_string(), "user_manager2".to_string()]),
..Default::default()
},
None,
)
.await?;
_, err := client.Notifications.Create(context.TODO(), &whopsdk.CreateNotificationsRequest{
AccountID: whopsdk.String("biz_xxxxxxxxxxxxxx"),
Title: "Action Required",
Content: "Please review and approve the pending invoices.",
UserIDs: []string{"user_manager1", "user_manager2"},
})
if err != nil {
log.Fatal(err)
}
rest_path로 딥 링크 연결하기
rest_path 매개변수를 사용하면 사용자가 알림을 탭할 때 앱의 특정 페이지로 이동시킬 수 있습니다.
앱 경로 설정하기
먼저 대시보드에서 동적 라우트 매개변수를 처리하도록 앱 경로를 구성하세요:- 개발자 대시보드에서 앱 설정으로 이동하세요
- 호스팅 섹션에서 “App path”에
[restPath]가 포함되도록 업데이트하세요
/experiences/[experienceId]/[restPath]
/companies/[companyId]/[restPath]
딥 링크가 포함된 알림 보내기
알림에rest_path 매개변수를 추가하세요. Whop이 이를 앱의 기본 URL에 덧붙입니다.
// Experience app: Direct to a specific workout
await client.notifications.create({
experience_id: 'exp_xxxxxxxxxxxxxx',
title: 'Today\'s Recommended Workout',
content: 'Based on your progress, we recommend this HIIT session.',
rest_path: '/workouts/hiit-advanced-1',
});
// Dashboard app: Direct to a specific report
await client.notifications.create({
account_id: 'biz_xxxxxxxxxxxxxx',
title: 'Unusual Activity Detected',
content: 'Review the flagged transactions in your dashboard.',
rest_path: '/reports/flagged-transactions',
});
# Experience app: Direct to a specific workout
client.notifications.create(
experience_id="exp_xxxxxxxxxxxxxx",
title="Today's Recommended Workout",
content="Based on your progress, we recommend this HIIT session.",
rest_path="/workouts/hiit-advanced-1",
)
# Dashboard app: Direct to a specific report
client.notifications.create(
account_id="biz_xxxxxxxxxxxxxx",
title="Unusual Activity Detected",
content="Review the flagged transactions in your dashboard.",
rest_path="/reports/flagged-transactions",
)
# Experience app: Direct to a specific workout
client.notifications.create(
experience_id: "exp_xxxxxxxxxxxxxx",
title: "Today's Recommended Workout",
content: "Based on your progress, we recommend this HIIT session.",
rest_path: "/workouts/hiit-advanced-1"
)
# Dashboard app: Direct to a specific report
client.notifications.create(
account_id: "biz_xxxxxxxxxxxxxx",
title: "Unusual Activity Detected",
content: "Review the flagged transactions in your dashboard.",
rest_path: "/reports/flagged-transactions"
)
// Experience app: Direct to a specific workout
client
.notifications
.create(
&CreateNotificationsRequest {
experience_id: Some("exp_xxxxxxxxxxxxxx".to_string()),
title: "Today's Recommended Workout".to_string(),
content: "Based on your progress, we recommend this HIIT session.".to_string(),
rest_path: Some("/workouts/hiit-advanced-1".to_string()),
..Default::default()
},
None,
)
.await?;
// Dashboard app: Direct to a specific report
client
.notifications
.create(
&CreateNotificationsRequest {
account_id: Some("biz_xxxxxxxxxxxxxx".to_string()),
title: "Unusual Activity Detected".to_string(),
content: "Review the flagged transactions in your dashboard.".to_string(),
rest_path: Some("/reports/flagged-transactions".to_string()),
..Default::default()
},
None,
)
.await?;
// Experience app: Direct to a specific workout
_, err := client.Notifications.Create(context.TODO(), &whopsdk.CreateNotificationsRequest{
ExperienceID: whopsdk.String("exp_xxxxxxxxxxxxxx"),
Title: "Today's Recommended Workout",
Content: "Based on your progress, we recommend this HIIT session.",
RestPath: whopsdk.String("/workouts/hiit-advanced-1"),
})
if err != nil {
log.Fatal(err)
}
// Dashboard app: Direct to a specific report
_, err = client.Notifications.Create(context.TODO(), &whopsdk.CreateNotificationsRequest{
AccountID: whopsdk.String("biz_xxxxxxxxxxxxxx"),
Title: "Unusual Activity Detected",
Content: "Review the flagged transactions in your dashboard.",
RestPath: whopsdk.String("/reports/flagged-transactions"),
})
if err != nil {
log.Fatal(err)
}
앱에서 라우트 처리하기
사용자가 알림을 탭하면 Whop은 앱 경로와rest_path로 구성된 전체 URL로 사용자를 이동시킵니다.
경험 앱 예시:
앱을 https://your-app.com에서 호스팅하고 다음을 보내는 경우:
rest_path: "/posts/post_123";
https://your-app.com/experiences/exp_xxxxxxxxxxxxxx/posts/post_123
app/experiences/[experienceId]/posts/[postId]/page.tsx
app.get("/experiences/:experienceId/posts/:postId", (req, res) => {
// Handle the notification deep link
});
rest_path: "?action=review&id=123";
사용자 지정 알림 아이콘
기본적으로 알림에는 경험 아바타, 계정 아바타 또는 둘 다 표시됩니다. 사용하려는 프로필 사진의 Whop 사용자 ID를 제공하여 아이콘을 사용자 지정하세요.await client.notifications.create({
experience_id: 'exp_xxxxxxxxxxxxxx',
title: 'New Comment',
content: 'Sarah replied to your post: "Great progress!"',
icon_user_id: 'user_xxxxxxxxxxxxx',
rest_path: '/posts/my-post-123',
});
client.notifications.create(
experience_id="exp_xxxxxxxxxxxxxx",
title="New Comment",
content='Sarah replied to your post: "Great progress!"',
icon_user_id="user_xxxxxxxxxxxxx",
rest_path="/posts/my-post-123",
)
client.notifications.create(
experience_id: "exp_xxxxxxxxxxxxxx",
title: "New Comment",
content: 'Sarah replied to your post: "Great progress!"',
icon_user_id: "user_xxxxxxxxxxxxx",
rest_path: "/posts/my-post-123"
)
client
.notifications
.create(
&CreateNotificationsRequest {
experience_id: Some("exp_xxxxxxxxxxxxxx".to_string()),
title: "New Comment".to_string(),
content: "Sarah replied to your post: \"Great progress!\"".to_string(),
icon_user_id: Some("user_sarah123".to_string()),
rest_path: Some("/posts/my-post-123".to_string()),
..Default::default()
},
None,
)
.await?;
_, err := client.Notifications.Create(context.TODO(), &whopsdk.CreateNotificationsRequest{
ExperienceID: whopsdk.String("exp_xxxxxxxxxxxxxx"),
Title: "New Comment",
Content: `Sarah replied to your post: "Great progress!"`,
IconUserID: whopsdk.String("user_sarah123"),
RestPath: whopsdk.String("/posts/my-post-123"),
})
if err != nil {
log.Fatal(err)
}
다음 단계
챗봇 만들기
알림과 인앱 메시지를 함께 사용하여 사용자가 어디에 있든 알림을 받도록 하세요.
웹훅 수신하기
payment.succeeded, membership.activated 및 기타 서버 이벤트를 기반으로 알림을 트리거하세요.포럼
포럼 경험에 새 게시물이나 댓글이 올라오면 사용자에게 알리세요.
권한 요청하기
알림이 성공적으로 전송되도록 앱의 권한 설정을 확인하세요.

