Type-Safe by Default
Grain SDK is written in TypeScript and includes complete type definitions:@types packages needed - types are built-in.
Configuration Types
Full type safety for configuration:Event Types
Type your event properties:Template Event Types
Template methods have built-in types:Custom Event Types
Create type-safe custom events:React Hook Types
Hooks have full type inference:Generic Client Type
For dependency injection or testing:Strict Null Checks
SDK works with strict null checks:Auth Provider Types
Type-safe auth providers:Remote Config Types
Type your configurations:Enum Event Names
Use enums for event names:Type Guards
Create type guards for safer code:Exporting Types
Re-export types for your app:Testing with Types
Type-safe testing:Type-Safe Wrappers
Create type-safe wrappers for your domain:Best Practices
1. Use Type Imports: Import only types when possible:Next Steps
API Reference
See all available types
React Hooks
Type-safe React integration