security plugin for babel that checks for accidental API keys in your source code
Last updated 2 years ago by pco .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install babel-plugin-secure-syntax 
SYNC missed versions from official npm registry.

Secure Syntax

This is a Babel plugin for throwing a class of SyntaxErrors when API keys are detected in your source code. When you write API keys in-line, you become subject to unnecessary risks that occur from accidentally leaking your secrets to the world.


Install using npm or Yarn by adding babel-plugin-secure-syntax as a dev dependency to your project:

Using npm:

npm install --save-dev babel-plugin-secure-syntax

Using Yarn:

yarn add --dev babel-plugin-secure-syntax

This will add babel-plugin-secure-syntax to your package.json for use in development, but won't classify this plugin as a dependency if someone were to npm install your package.


  • babel: 6.x.x



The easiest way to use babel-plugin-secure-syntax is by adding it to your .babelrc file.

Find the "plugins" key in your .babelrc and add "secure-syntax" to the list of plugins:

  "plugins": "secure-syntax"

Babel Transform

If you're running Babel transforms in your application code using babel.transform(), simply require the plugin and add it to the plugins array:

const SecureSyntax = require("babel-plugin-secure-syntax");
const transform = (source) => babel.transform(source, { plugins: [SecureSyntax] });


Helping others find in-line API keys in their source code is the point of this plugin, so please open a PR to add any missing API key regular expressions.


This package is maintained by the RunKit team. Please feel free to file an issue or reach out to us at

Current Tags

  • 1.0.3                                ...           latest (2 years ago)

4 Versions

  • 1.0.3                                ...           2 years ago
  • 1.0.2                                ...           2 years ago
  • 1.0.1                                ...           2 years ago
  • 1.0.0                                ...           2 years ago
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (3)
Dev Dependencies (10)
Dependents (0)

Copyright 2014 - 2016 © |