How do I create a zod object with dynamic keys? April 4, 2024 by Tarik You’re looking for z.record which can be used like: const data = z.record(z.string(), z.string());