Connect your frontend
AWS Blocks generates a typed client from your backend so your frontend calls methods directly — there is no code to write for the transport. How you generate and authenticate the client depends on your platform.
AWS Blocks provides native clients for Swift, Kotlin, and Dart/Flutter. These are build-time code generators that produce a type-safe client from your backend's Blocks spec (blocks.spec.json), paired with a runtime library that calls your backend over JSON-RPC.
Generate the native client
Each native client generates type-safe code from your backend's blocks.spec.json:
- Dart/Flutter — generates a typed Dart client from your Blocks spec.
Find the Blocks API URL under custom.blocks_api_url in the amplify_outputs.json produced by your deployment, and point the generated client at it.
Authenticate with your Amplify session
Protected Blocks operations expect the Cognito token Amplify issues. Use the Amplify Auth library for your platform to fetch the current session's ID token and attach it as a Bearer token on requests the native client sends. On the backend, CognitoVerifier validates that token against the same user pool — no separate sign-in is required.
Next steps
- Review how the integration works.
- See the AWS Blocks Developer Guide for the full client and API reference.