MCPcopy Index your code
hub / github.com/codeaashu/claude-code / fetchReferralEligibility

Function fetchReferralEligibility

src/services/api/referral.ts:26–45  ·  view source on GitHub ↗
(
  campaign: ReferralCampaign = 'claude_code_guest_pass',
)

Source from the content-addressed store, hash-verified

24let fetchInProgress: Promise<ReferralEligibilityResponse | null> | null = null
25
26export async function fetchReferralEligibility(
27 campaign: ReferralCampaign = 'claude_code_guest_pass',
28): Promise<ReferralEligibilityResponse> {
29 const { accessToken, orgUUID } = await prepareApiRequest()
30
31 const headers = {
32 ...getOAuthHeaders(accessToken),
33 'x-organization-uuid': orgUUID,
34 }
35
36 const url = `${getOauthConfig().BASE_API_URL}/api/oauth/organizations/${orgUUID}/referral/eligibility`
37
38 const response = await axios.get(url, {
39 headers,
40 params: { campaign },
41 timeout: 5000, // 5 second timeout for background fetch
42 })
43
44 return response.data
45}
46
47export async function fetchReferralRedemptions(
48 campaign: string = 'claude_code_guest_pass',

Callers 1

Calls 4

prepareApiRequestFunction · 0.85
getOAuthHeadersFunction · 0.85
getOauthConfigFunction · 0.85
getMethod · 0.65

Tested by

no test coverage detected