Faker Configuration
Hyper Studio integrates with Faker.js to allow you to define how mock data is generated for your collections during seeding or testing.
Faker configuration is available for both Auth and Normal collections, but not for System Generated collections.
- Navigate to Studio > Collections.
- Select a collection from the list.
- Click the Options tab in the top navigation bar.
- Click the Faker sub-tab.
How it Works
When you configure Faker for a field, Hyper Studio uses that configuration to generate realistic mock data.
To prevent overwhelming options, the Studio automatically filters the available Faker methods based on the field's data type (for example, text fields get string/name options, date fields get date options).
Configuring Faker for a Field
- In the Faker Configuration view, select a field from the left panel.
- Browse or search for a Faker method using the search bar ().
- Select a method from the categorized list (for example, Date & Time -> Any Date).
- If the method supports parameters (like a reference date or a range), configure them in the Parameters panel on the right.
- Review the generated output in the Preview panel to ensure it matches your expectations.
- Click Save Changes (top-right) to apply the configuration.
To remove a Faker configuration from a field, click the trash icon () next to the selected method.
Common Examples
While the Studio supports a vast catalog of methods, here are some common use cases:
| Field Type | Suggested Faker Category/Method | Output Example |
|---|---|---|
| Single Line | Person -> Full Name | John Doe |
Internet -> Email | john.doe@example.com | |
| Date | Date & Time -> Any Date | 2025-09-29 |
| Phone | Phone -> Number | 555-123-4567 |
For the full list of available methods and their behavior, refer to the Faker.js Documentation.