# a4web

> Arxan for Web

Latest version **3.9.0** (published 2020-11-30) · BSD-2-Clause license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install a4web
pnpm add a4web
yarn add a4web
bun add a4web
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 3.9.0 |
| Published | 2020-11-30 |
| First published | 2020-03-27 |
| Weekly downloads | 0 |
| License | BSD-2-Clause |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 8 |
| Unpacked size | 18.5 KB |
| Known vulnerabilities | 0 (+3 in 2 direct dependencies) |
| Install scripts | yes |
| Author | Arxan NPM |
| Maintainers | arxan |
| Keywords | arxan4web, a4web |

## Links

- npm: https://www.npmjs.com/package/a4web
- npm.io page: https://npm.io/package/a4web

## Dependencies (8)

- [dmg](https://npm.io/package/dmg.md) ^0.1.0
- [tmp](https://npm.io/package/tmp.md) ^0.1.0
- [request](https://npm.io/package/request.md) ^2.34.0
- [download](https://npm.io/package/download.md) ^7.1.0
- [fs-extra](https://npm.io/package/fs-extra.md) ^8.1.0
- [querystring](https://npm.io/package/querystring.md) ^0.2.0
- [child-process-promise](https://npm.io/package/child-process-promise.md) ^2.2.1
- [request-promise-native](https://npm.io/package/request-promise-native.md) ^1.0.7

## Recent versions

- 3.9.0 (latest) — 2020-11-30
- 3.8.0 — 2020-10-28
- 3.7.0 — 2020-10-01
- 3.6.0 — 2020-09-03
- 3.5.0 — 2020-07-23
- 3.4.0 — 2020-06-11
- 3.3.0 — 2020-05-15
- 3.2.0 — 2020-04-16
- 3.1.0 — 2020-03-27
- 3.0.0-a — 2020-03-27

## README

# Arxan for Web Installation Manager

Integrate Arxan protection into your npm or webpack workflow.

## Prerequisites

Before you can install or use this package, you must:

1. Be a current Arxan customer.
2. Review the platform requirements in the most recent version of the *Arxan for Web* online help, which is available from Arxan.
3. Obtain an API Key, API Secret, and License Token from Arxan.
    * Make sure the API Key has the "Product download" checkbox checked.
4. Add the following environment variables:

```
A4WEB_API_KEY="myapikey"
A4WEB_API_SECRET="mysecret"
A4WEB_LICENSE_TOKEN="mylicensetoken"
```

**NOTE:** This package should not be installed globally.

## Protect

This package offers production-ready essential protection that quickly and automatically adds additional security and tamper detection to your code without any manual configuration.

To run protection, add the following code at the end of your build:

```
const {protect} = require('a4web');
const blueprint = {
    targets: {
        main: {
            "input": "./dist",
            "outputDirectory": "./dist_protected"
        }
    }
}
protect(blueprint).then((output) => {
    console.log(output.stdout);
    console.error(output.stderr);
}).catch((err) => {
    console.error(err.message);
});
```

Notice the object called `blueprint`. To apply essential protection, you only need to modify the values of `"input"` and `"outputDirectory"`, where `"./dist"` is the directory that contains your input files and `"./dist_protected"` is the directory where the final protected files will appear.

However, you can further customize your protection by modifying the `blueprint` object. For instructions, see the *Arxan for Web* online help, which is available from Arxan.


### Protect with Webpack

To run protection within a webpack bundle, add the protection code to `webpack.config.js`.

This example applies essential protection:

```
const {WebpackPlugin} = require('a4web');
module.exports = {
    plugins : [
        new WebpackPlugin()
    ]
}
```

This example uses a blueprint. If you leave the code as is, it will apply essential protection. However, you can also modify the blueprint as described previously:

```
const {WebpackPlugin} = require('a4web');
const blueprint = {
    guardConfigurations: {
        config : {
            "debugDetection": {
                "disable": true
            }
        }
    }
}
module.exports = {
    plugins : [
        new WebpackPlugin(blueprint)
    ]
}
```

To see the protection summary, add the ```stats``` field, as follows:

```
const {WebpackPlugin} = require('a4web');
module.exports = {
    stats: {
        logging: 'log'
    },
    plugins : [
        new WebpackPlugin()
    ]
}
```

You can set the following values for ```logging```:
- none - disable logging
- log - displays errors, warnings, info messages, and log messages

## Learn More

Visit www.arxan.com to learn more about Arxan's protection solutions.

---
_Source: https://npm.io/package/a4web · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
