typesafe-actions: Typed Action Creators for Redux Without the Boilerplate
Typesafe utilities for "action-creators" in Redux / Flux Architecture
At a glance
- What is it?
- typesafe-actions is an MIT-licensed TypeScript library that removes the repetition from Redux action creators and reducers. It installs from npm in one command, but its README still points v5 users at a GitHub issue for API docs.
- Who is it for?
- Adopt typesafe-actions if you write Redux in TypeScript and want action types and reducer state inferred instead of declared by hand, and you can work from the README plus the v5 API issue. Do not adopt it if you need current, complete documentation or a recently released package: the last tagged release is v5.1.0 from 2019-11-05.
- Can I use it commercially?
- Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Yes. The repository last received commits 147 days ago.
- What is it written in?
- Mainly TypeScript, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on October 2, 2026, and from our analysis. They are not legal advice.
Editorial analysis
The Redux typing tax typesafe-actions removes
Redux in TypeScript has a specific failure mode. You write a string constant, then an action interface, then a union of those interfaces, then a reducer that switches on the constant, then a discriminated union in the store. Every new action means editing four places, and the compiler only tells you that you missed one when something downstream breaks. typesafe-actions targets that repetition directly. The README frames the goal as reducing types "verbosity" and "complexity" in Redux architecture.
The intended audience is a team already committed to Redux or Flux and already compiling with TypeScript. It is not a state management library. It does not replace the store, middleware or selectors. It sits at the point where action objects are created and where reducers consume them, and it derives the types from the values you write rather than asking you to write the types first. If your project is plain JavaScript, or if you have moved off Redux, the library has nothing to offer you.
How action creators, reducers and helper types fit together
The API splits into three groups. Action creators build action objects: action, createAction, createStandardAction, createCustomAction and createAsyncAction. Reducer creators provide createReducer, which takes a map of handlers keyed by action type instead of a switch statement. Helper types and functions glue the two: ActionType and StateType extract types from existing values, while getType, isActionOf and isOfType narrow an action inside a handler.
The data flow is ordinary Redux. A creator returns a plain object with a type field and whatever payload you configured. createReducer receives that object, looks up the handler by its type, and returns the new state. What changes is where the type information comes from. Because the creator's return type is concrete, ActionType can read the union out of the creators themselves, so the union is a derived value rather than a hand-maintained list. The README notes the library has no third-party dependencies, and that the distribution ships as cjs, esm and umd bundles with separate dev and production builds.
One structural detail worth knowing: the README's table of contents describes extending internal types to enable a type-free syntax with createReducer. That is a global declaration merge, and like any global augmentation it applies to your whole compilation. It is convenient in a small app and awkward in a monorepo where two packages might want different behaviour.
Installing typesafe-actions and writing a first reducer
Installation is a single package with no peer dependency listed in package.json. The README gives both package managers:
npm install typesafe-actionsThe yarn equivalent in the README is `yarn add typesafe-actions`. The package.json declares `"engines": { "node": ">= 4" }`, so the install itself is not going to be the constraint; your TypeScript version is.
After installing, the first real use is a creator plus a reducer. The README's tutorial builds a todo app and starts from constants, then actions, then reducers. That tutorial is labelled v4, and the README states the current API docs and tutorial are outdated from v4, pointing readers at a GitHub issue as temporary v5 API docs. The README's table of contents lists the v4 API sections for `createAction`, `createStandardAction`, `createAsyncAction` and `createReducer`, but the body of those sections is not reproduced in the truncated README text, so the exact signatures are not available to quote here.
What the README does state clearly is the intended shape of the workflow: you declare action creators, derive the action union from them, and pass that union into the reducer creator so handler parameters are inferred rather than annotated. It also points to a Codesandbox todo-app playground and a RealWorld app repository for working examples, which is the safer place to copy runnable code from than a truncated README. Read those before writing your first reducer, and confirm signatures against the v5 API issue.
Where typesafe-actions stops being the right tool
The most concrete limitation is documentation lag, and the README says so itself. The v5 release note in the README carries a warning that the library was recently updated to v5 and that current API docs and tutorial are outdated from v4, with a GitHub issue standing in as the v5 API reference. A library whose own README redirects you to an issue tracker for its API surface is asking you to read source and type tests. That is a real cost on a team where not everyone reads declaration files.
The second limitation is scope. typesafe-actions only types actions and reducers. Async flows are not solved by the library; the README's tutorial shows integration with redux-observable epics and redux-saga sagas, which means you still choose and configure a side-effect library. If your pain is in selectors, normalized state or async orchestration, this package addresses none of it.
Third, the type helpers are TypeScript-version sensitive. The README states the library was updated to support TypeScript v3.7 and describes the test suite as including extra type-tests to guarantee type soundness and prevent regressions in future TypeScript versions. That is a maintenance commitment, and it is the kind of thing that breaks when the compiler changes faster than the library does. If you pin an old TypeScript, you are outside the tested matrix.
typesafe-actions compared with redux-actions
The README includes a comparison section against redux-actions, and the difference is where type safety is enforced. redux-actions is a JavaScript-first library with TypeScript definitions layered on top. Its createAction and handleAction accept generic parameters you supply, so the burden of keeping action types and reducer types aligned stays with you. typesafe-actions inverts that: the creator's return type is the source of truth, and ActionType and StateType extract from it.
In practice this means the two libraries fail differently. With redux-actions, a mismatch between your declared payload type and what the reducer assumes is something you can write and only notice at runtime. With typesafe-actions, the reducer's handler parameter is inferred from the creator, so that mismatch is a compile error. The trade is that inference-heavy types are harder to read in editor tooltips and can slow the language server on large unions. The repository includes a benchmarks directory and the README mentions `npm run benchmark:XXX` scripts intended to keep the computational complexity of the types in check, which is an acknowledgement that this cost is real.
Maintenance status, licence and upgrade cost
The repository is not archived, and the last push was on 2026-05-09. The most recent tagged release, however, is v5.1.0 from 2019-11-05, with v4.4.2 and v4.4.1 before it in 2019. Activity on master and release cadence are therefore two different pictures, and anyone evaluating the project should look at both rather than at the commit graph alone.
The licence is MIT, declared in both package.json and the LICENSE file at the repository root. MIT permits commercial use and modification; it also means no warranty and no support obligation from the author. Nothing in the repository suggests a contributor licence agreement or a dual-licence model, but this is a description of the files, not legal advice.
Upgrade cost is dominated by the v4 to v5 migration. The README ships migration guides from v1 through v5 and a separate guide for migrating from redux-actions, which tells you the author expects breaking changes across majors. Because the v5 API documentation is incomplete, a v4 codebase moving to v5 is a source-reading exercise. Budget for that before starting. The package also publishes separate dev and production bundles and three module formats, so bundler configuration that assumes a single entry point may need attention.
Editorial conclusion
Adopt typesafe-actions if you write Redux in TypeScript and want action types and reducer state inferred instead of declared by hand, and you can work from the README plus the v5 API issue. Do not adopt it if you need current, complete documentation or a recently released package: the last tagged release is v5.1.0 from 2019-11-05. Before committing, check that createReducer's handler keys match your action creator output types under your installed TypeScript version, because the README warns the v4 tutorial and API pages are outdated for v5.
Frequently asked questions
What is typesafe-actions in Redux?
It is a TypeScript utility library that creates typesafe action creators and reducers for Redux or Flux architectures, reducing the amount of type annotation you write by hand. It also exports helper types such as ActionType and StateType that derive types from existing values.
How do I install typesafe-actions?
The README gives two commands: npm install typesafe-actions, or yarn add typesafe-actions. The package has no third-party dependencies according to the README, and package.json declares Node >= 4.
What is an action creator in Redux?
An action creator is a function that returns an action object. In typesafe-actions, creators such as createAction, createStandardAction and createAsyncAction build those objects, and their return types become the source of truth for ActionType.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/piotrwitek-typesafe-actions)