Skip to content

Conversation

@phdargen
Copy link
Contributor

@phdargen phdargen commented Jan 15, 2026

Description

Both v2 and v1 server should work with the same create_facilitator_config function from cdp-sdk.

  • create_facilitator_config returns url + create_headers but V2's HTTPFacilitatorClient expects url+ auth_provider: updated HTTPFacilitatorClient to also accept url + create_headers

  • create_headers is async but V2 client is sync: create_headers made sync in add create_facilitator_config for x402 python v2 cdp-sdk#555

  • adds a iscoroutine check in legacy facilitator.py to support sync and async (for backwards compatibility) create_headers

Tests

Manually tested with modified v2 fastapi example by replacing:
facilitator = HTTPFacilitatorClient(FacilitatorConfig(url=FACILITATOR_URL)) with:

facilitator_config = create_facilitator_config(CDP_API_KEY_ID, CDP_API_KEY_SECRET)
facilitator = HTTPFacilitatorClient(facilitator_config)

Checklist

  • I have formatted and linted my code
  • All new and existing tests pass
  • My commits are signed (required for merge) -- you may need to rebase if you initially pushed unsigned commits

@vercel
Copy link

vercel bot commented Jan 15, 2026

@phdargen is attempting to deploy a commit to the Coinbase Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions bot added sdk Changes to core v2 packages python legacy Changes to legacy sdk or examples labels Jan 15, 2026
@phdargen phdargen changed the title make create_facilitator_config work with both V1 and V2 python-v2: make create_facilitator_config work with both V1 and V2 Jan 15, 2026
@CarsonRoscoe CarsonRoscoe merged commit 35cc3f0 into coinbase:feat/python-v2-sdk Jan 15, 2026
13 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

legacy Changes to legacy sdk or examples python sdk Changes to core v2 packages

Development

Successfully merging this pull request may close these issues.

2 participants