MCPcopy
hub / github.com/codeaashu/claude-code / fetchReferralRedemptions

Function fetchReferralRedemptions

src/services/api/referral.ts:47–66  ·  view source on GitHub ↗
(
  campaign: string = 'claude_code_guest_pass',
)

Source from the content-addressed store, hash-verified

45}
46
47export async function fetchReferralRedemptions(
48 campaign: string = 'claude_code_guest_pass',
49): Promise<ReferralRedemptionsResponse> {
50 const { accessToken, orgUUID } = await prepareApiRequest()
51
52 const headers = {
53 ...getOAuthHeaders(accessToken),
54 'x-organization-uuid': orgUUID,
55 }
56
57 const url = `${getOauthConfig().BASE_API_URL}/api/oauth/organizations/${orgUUID}/referral/redemptions`
58
59 const response = await axios.get<ReferralRedemptionsResponse>(url, {
60 headers,
61 params: { campaign },
62 timeout: 10000, // 10 second timeout
63 })
64
65 return response.data
66}
67
68/**
69 * Prechecks for if user can access guest passes feature

Callers 1

loadPassesDataFunction · 0.85

Calls 3

prepareApiRequestFunction · 0.85
getOAuthHeadersFunction · 0.85
getOauthConfigFunction · 0.85

Tested by

no test coverage detected