Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

mongodb-realm-cli

10gen21.5kApache-2.02.6.2TypeScript support: included

The MongoDB Realm Command Line Interface

mongodb, realm

readme

MongoDB Realm CLI

Building the CLI

The CLI can be run many different ways. To install it globally on your machine, you can use npm to do so:

npm install -g mongodb-realm-cli

Running from Source

You may wish to run the CLI from source, in which case go provides a few different options.

Using go run

The entry point for the CLI is in main.go, so simply running go run main.go from the root of the project repo is equivalent to invoking the installed command realm-cli. It accepts commands and flags as normal.

The one caveat here is you may wish to be running the tool from a clean directory, so as not to write app configuration files to the project repo. However, for commands that do not interact with the local filesystem, this is often the quickest and easiest way to run from source.

Using go build

Another option would be to build your own executable for realm-cli, at which point you could either invoke directly or then place on your machine's path somewhere. To do so, simply run:

go build -o realm-cli main.go

The above will build an executable named realm-cli that can be run with calling ./realm-cli. It accepts commands and flags as normal.

You may wish to set other configuration details while creating a local build of the CLI. To do so, you'll need to leverage the -ldflags option of go build. Here is an example usage of that with some CLI configuration details set:

go build -ldflags "-X github.com/10gen/realm-cli/internal/cli.Version=0.0.0-local" -o realm-cli main.go

This will create a CLI build that will print 0.0.0-local when --version is invoked. Other configurable build options include:

  • -X github.com/10gen/realm-cli/internal/cli.OSArch=macos-amd64
  • -X github.com/10gen/realm-cli/internal/telemetry.segmentWriteKey=${segment_write_key}

NOTE: ${segment_write_key} is a dynamic value you would need to replace with something valid. If it is left blank, then events will simply not be sent to Segment.

Using go install

Lastly, you can use go install which will build the realm-cli executable and install it in $GOPATH/bin (making it readily accessible throughout your machine). To do so, run:

go install

Additionally, the same -ldflags apply for go install as they do go build should you wish to configure this build further.

Running the CLI Locally

To run the CLI locally, you will want to have Realm server locally and capable of communicating with an Atlas instance for authentication. The recommended way to do this would be run baas with the local_cloud_dev_config.json server config via:

go run -exec="env LD_LIBRARY_PATH=$LD_LIBRARY_PATH" cmd/server/main.go --configFile etc/configs/local_cloud_dev_config.json

At which point you will have the necessary environment to run CLI commands that talk to a local Realm server and the Cloud Dev Atlas instance.

Authentication

To run any meaningful commands, you'll need to have an Atlas programmatic API Key created in the Atlas environment you are targeting to run with. In tha above setup, that would be on https://cloud-dev.mongodb.com, so ensure you create you API Key from there.

Using the Profile

With an API Key ready to be used, it's time to configure your profile with these details so you can easily execute commands with these details configured. The first thing you'll need to do is login, so the recommended command would be:

realm-cli login --profile local --api-key ${api_key} --private-api-key ${private_api_key} --realm-url http://localhost:8080 --atlas-url https://cloud-dev.mongodb.com

NOTE: Feel free to omit the --api-key and --private-api-key flags if you wish to run the command interactively. However, you must still remember to set the url flags (and optionally profile name) in order to talk to the right instances of Realm and Atlas.

By running this command, you've now created a "local" profile that knows your API Key credentials and the base URLs of the servers you wish to talk with. This profile is now also responsible for managing your active session with Realm. You can view all of these details on your machine at ~/.config/realm-cli/${profile}.yaml (where ${profile} is the name you supplied to the --profile flag).

After you successfully login, you will then be able to execute further commands by just specifying the same profile:

realm-cli --profile local whoami

realm-cli --profile local apps list

The base urls (among other details like API Key credentials and telemetry mode) can be considered as "sticky" flags. Whenever they are provided and set, that particular profile (or the default profile if none is specified) will remember the new values going forward (read: they only need to be provided/set once).

Linting

To lint the project, run:

golangci-lint run

Note: golangci-lint panics on M1 machines with a can't load fmt error. This issue is documented here. While this is still being fixed, it seems that installing golangci-lint from source resolves the issue.

Testing

Unit Testing

To run unit tests:

go test -v -tags debug github.com/10gen/realm-cli/internal/... -run 'Test'

No environment variables should be necessary for running the CLI unit tests. You should see skipped tests for any of the integration tests that do require environment variables set and/or other servers running to talk to.

Integration Tests with Realm Server

To run integration tests against a Realm server locally, run baas with the local_cloud_dev_config.json server config via:

go run -exec="env LD_LIBRARY_PATH=$LD_LIBRARY_PATH" cmd/server/main.go --configFile etc/configs/local_cloud_dev_config.json

Then, from the realm-cli project root, simply run:

BAAS_MONGODB_CLOUD_GROUP_ID=${cloud_group_id} BAAS_MONGODB_CLOUD_GROUP_NAME=${cloud_group_name} BAAS_MONGODB_CLOUD_USERNAME=${cloud_username} BAAS_MONGODB_CLOUD_API_KEY=${cloud_api_key} go test -v -tags debug github.com/10gen/realm-cli/internal/cloud/... -run 'Test'

NOTE: With the above, you'll need to substitute ${cloud_group_id}, ${cloud_group_name}, ${cloud_username}, and ${cloud_api_key} with valid credentials of your own from https://cloud-dev.mongodb.com. Various other integration tests may rely on further environment variables you may wish to set, refer to internal/utils/test/test.go for more details.

Debugging an Interactive Test

Have a test that relies on prompts to the user for input? The go-expect framework handles those interactions and relies on "expected" output to wait for until proceeding with further instruction. Often times, this can result in a test hanging indefinitely if the expected output doesn't match. Unfortunately, in this case only a Ctrl+C (or timeout) ends the test and you are left without any output to inspect in order to determine a root cause.

If you want to actually see the output headed to your "pseudo-terminal", you just have to use a different stdout than the *bytes.Buffer tests usually rely on. For example:

out, outErr := mock.FileWriter(t)
assert.Nil(t, outErr)
defer out.Close()

c, err := expect.NewConsole(expect.WithStdout(out))
assert.Nil(t, err)
defer c.Close()

Undocumented Features and Flags

Global Flags

Using --realm-url and --atlas-url

At some point, you may wish to configure which Realm and Atlas servers the CLI is connecting to. By default, these URLs point to the Production instances of Realm and Atlas, which should be sufficient for most use cases.

However, you can set --realm-url and --atlas-url to any URLs you know a respective server instance is running at. If you are configuring one, chances are you'll want to configure both of these.

Pseudo-Global Flags

Using --project

At some point, you may wish to target a specific "project id" (a.k.a. "group id") when performing any sort of app lookup. By default, the project id is derived from the list of projects available to the logged in user, which should be sufficient for most use cases (but may force a prompt for a project selection, thus breaking typical CI/CD setups). The impact of this setting effects only the prompts presented by the CLI (and the data found within them) to allow the user to select a project (and ultimately an app) to work with.

However, you can set --project to any known project id. Most commands which interact with a specific app support the use of --project:

  • accesslist create
  • accesslist delete
  • accesslist list
  • accesslist update
  • app create
  • app delete
  • app describe
  • app diff
  • app init
  • apps list
  • function run
  • logs list
  • pull
  • push
  • schema models
  • secrets create
  • secret delete
  • secrets list
  • secret update
  • user create
  • user delete
  • user disable
  • user enable
  • users list
  • user revoke

Using --config-version

At some point, you may wish to target a specific "config version" of an app. By default, the config version chosen is the latest and most up-to-date, which should be sufficient for most use cases.

However, you can set --config-version to any previously supported config version. The supported values can be found at internal/cloud/realm/realm.go. The following commands support the use of --config-version:

  • app create
  • app init
  • pull/export

Using --product

At some point, you may wish to target a specific "product type" when performing any sort of app lookup. By default, the product types queried for include "standard" and "atlas", which should be sufficient for most use cases. The impact of this setting effects only the prompts presented by the CLI (and the data found within them) to allow the user to select an app to work with.

However, you can set --product to any known app product type. Most commands which interact with a specific app support the use of --product:

  • accesslist create
  • accesslist delete
  • accesslist list
  • accesslist update
  • app describe
  • apps list
  • function run
  • logs list
  • schema models
  • secrets create
  • secret delete
  • secrets list
  • secret update
  • user create
  • user delete
  • user disable
  • user enable
  • users list

Login Flags

The login command supports multiple ways of authenticating with Realm. By default, the CLI will authenticate against MongoDB Cloud Atlas using a programmatic API Key, which should be sufficient (and even recommended) for most use cases.

However, you can set --auth-type to any other supported authentication type. The supported values can be found at internal/commands/login/inputs.go.

If you are using the "local" auth type, you will also need to specify both --username and --password. If you do not specify these as flags, the CLI will prompt you for these inputs. The username and password must correspond to a local-userpass user known to exist on the Realm server the CLI is configured to talk to.

changelog

Changelog

0.21.4 (September 6, 2021)

Fixes and Functionality:

  • Fixing JSON transform when data is stringified. Providing backward compatibility and complying to the JSON RFC standard (#4020)

Huge thanks to everyone who contributed to this release via code (authors listed below) or via reviews and triaging on GitHub:

0.21.3 (September 4, 2021)

Fixes and Functionality:

  • Fixing response interceptor not being called when request interceptor is attached (#4013)

Huge thanks to everyone who contributed to this release via code (authors listed below) or via reviews and triaging on GitHub:

0.21.2 (September 4, 2021)

Fixes and Functionality:

  • Updating axios requests to be delayed by pre-emptive promise creation (#2702)
  • Adding "synchronous" and "runWhen" options to interceptors api (#2702)
  • Updating of transformResponse (#3377)
  • Adding ability to omit User-Agent header (#3703)
  • Adding multiple JSON improvements (#3688, #3763)
  • Fixing quadratic runtime and extra memory usage when setting a maxContentLength (#3738)
  • Adding parseInt to config.timeout (#3781)
  • Adding custom return type support to interceptor (#3783)
  • Adding security fix for ReDoS vulnerability (#3980)

Internal and Tests:

  • Updating build dev dependancies (#3401)
  • Fixing builds running on Travis CI (#3538)
  • Updating follow rediect version (#3694, #3771)
  • Updating karma sauce launcher to fix failing sauce tests (#3712, #3717)
  • Updating content-type header for application/json to not contain charset field, according do RFC 8259 (#2154)
  • Fixing tests by bumping karma-sauce-launcher version (#3813)
  • Changing testing process from Travis CI to GitHub Actions (#3938)

Documentation:

  • Updating documentation around the use of AUTH_TOKEN with multiple domain endpoints (#3539)
  • Remove duplication of item in changelog (#3523)
  • Fixing gramatical errors (#2642)
  • Fixing spelling error (#3567)
  • Moving gitpod metion (#2637)
  • Adding new axios documentation website link (#3681, #3707)
  • Updating documentation around dispatching requests (#3772)
  • Adding documentation for the type guard isAxiosError (#3767)
  • Adding explanation of cancel token (#3803)
  • Updating CI status badge (#3953)
  • Fixing errors with JSON documentation (#3936)
  • Fixing README typo under Request Config (#3825)
  • Adding axios-multi-api to the ecosystem file (#3817)
  • Adding SECURITY.md to properly disclose security vulnerabilities (#3981)

Huge thanks to everyone who contributed to this release via code (authors listed below) or via reviews and triaging on GitHub:

0.21.1 (December 21, 2020)

Fixes and Functionality:

  • Hotfix: Prevent SSRF (#3410)
  • Protocol not parsed when setting proxy config from env vars (#3070)
  • Updating axios in types to be lower case (#2797)
  • Adding a type guard for AxiosError (#2949)

Internal and Tests:

  • Remove the skipping of the socket http test (#3364)
  • Use different socket for Win32 test (#3375)

Huge thanks to everyone who contributed to this release via code (authors listed below) or via reviews and triaging on GitHub:

0.21.0 (October 23, 2020)

Fixes and Functionality:

  • Fixing requestHeaders.Authorization (#3287)
  • Fixing node types (#3237)
  • Fixing axios.delete ignores config.data (#3282)
  • Revert "Fixing overwrite Blob/File type as Content-Type in browser. (#1773)" (#3289)
  • Fixing an issue that type 'null' and 'undefined' is not assignable to validateStatus when typescript strict option is enabled (#3200)

Internal and Tests:

  • Lock travis to not use node v15 (#3361)

Documentation:

  • Fixing simple typo, existant -> existent (#3252)
  • Fixing typos (#3309)

Huge thanks to everyone who contributed to this release via code (authors listed below) or via reviews and triaging on GitHub:

0.20.0 (August 20, 2020)

Release of 0.20.0-pre as a full release with no other changes.

0.20.0-pre (July 15, 2020)

Fixes and Functionality:

  • Fixing response with utf-8 BOM can not parse to json (#2419)
    • fix: remove byte order marker (UTF-8 BOM) when transform response
    • fix: remove BOM only utf-8
    • test: utf-8 BOM
    • fix: incorrect param name
  • Refactor mergeConfig without utils.deepMerge (#2844)
    • Adding failing test
    • Fixing #2587 default custom config persisting
    • Adding Concat keys and filter duplicates
    • Fixed value from CPE
    • update for review feedbacks
    • no deepMerge
    • only merge between plain objects
    • fix rename
    • always merge config by mergeConfig
    • extract function mergeDeepProperties
    • refactor mergeConfig with all keys, and add special logic for validateStatus
    • add test for resetting headers
    • add lots of tests and fix a bug
    • should not inherit data
    • use simple toString
  • Fixing overwrite Blob/File type as Content-Type in browser. (#1773)
  • Fixing an issue that type 'null' is not assignable to validateStatus (#2773)
  • Fixing special char encoding (#1671)
    • removing @ character from replacement list since it is a reserved character
    • Updating buildURL test to not include the @ character
    • Removing console logs
  • Fixing password encoding with special characters in basic authentication (#1492)
    • Fixing password encoding with special characters in basic authentication
    • Adding test to check if password with non-Latin1 characters pass
  • Fixing 'Network Error' in react native android (#1487) There is a bug in react native Android platform when using get method. It will trigger a 'Network Error' when passing the requestData which is an empty string to request.send function. So if the requestData is an empty string we can set it to null as well to fix the bug.
  • Fixing Cookie Helper with Async Components (#1105) (#1107)
  • Fixing 'progressEvent' type (#2851)
    • Fix 'progressEvent' type
    • Update axios.ts
  • Fixing getting local files (file://) failed (#2470)
    • fix issue #2416, #2396
    • fix Eslint warn
    • Modify judgment conditions
    • add unit test
    • update unit test
    • update unit test
  • Allow PURGE method in typings (#2191)
  • Adding option to disable automatic decompression (#2661)
    • Adding ability to disable auto decompression
    • Updating decompress documentation in README
    • Fixing test\unit\adapters\http.js lint errors
    • Adding test for disabling auto decompression
    • Removing changes that fixed lint errors in tests
    • Removing formatting change to unit test
  • Add independent maxBodyLength option (#2781)
    • Add independent option to set the maximum size of the request body
    • Remove maxBodyLength check
    • Update README
    • Assert for error code and message
  • Adding responseEncoding to mergeConfig (#1745)
  • Compatible with follow-redirect aborts the request (#2689)
    • Compatible with follow-redirect aborts the request
    • Use the error code
  • Fix merging of params (#2656)
    • Name function to avoid ESLint func-names warning
    • Switch params config to merge list and update tests
    • Restore testing of both false and null
    • Restore test cases for keys without defaults
    • Include test for non-object values that aren't false-y.
  • Revert finally as then (#2683)

Internal and Tests:

  • Fix stale bot config (#3049)
    • fix stale bot config
    • fix multiple lines
  • Add days and change name to work (#3035)
  • Update close-issues.yml (#3031)
    • Update close-issues.yml Update close message to read better 😄
    • Fix use of quotations Use single quotes as per other .yml files
    • Remove user name form message
  • Add GitHub actions to close stale issues/prs (#3029)
    • prepare stale actions
    • update messages
    • Add exempt labels and lighten up comments
  • Add GitHub actions to close invalid issues (#3022)
    • add close actions
    • fix with checkout
    • update issue templates
    • add reminder
    • update close message
  • Add test with Node.js 12 (#2860)
    • test with Node.js 12
    • test with latest
  • Adding console log on sandbox server startup (#2210)
    • Adding console log on sandbox server startup
    • Update server.js Add server error handling
    • Update server.js Better error message, remove retry.
  • Adding tests for method options type definitions (#1996) Update tests.
  • Add test for redirecting with too large response (#2695)
  • Fixing unit test failure in Windows OS (#2601)
  • Fixing issue for HEAD method and gzipped response (#2666)
  • Fix tests in browsers (#2748)
  • chore: add jsdelivr and unpkg support (#2443)

Documentation:

  • Adding support for URLSearchParams in node (#1900)
    • Adding support for URLSearchParams in node
    • Remove un-needed code
    • Update utils.js
    • Make changes as suggested
  • Adding table of content (preview) (#3050)
    • add toc (preview)
    • remove toc in toc Signed-off-by: Moni usmoni@gmail.com
    • fix sublinks
    • fix indentation
    • remove redundant table links
    • update caps and indent
    • remove axios
  • Replace 'blacklist' with 'blocklist' (#3006)
  • docs(): Detailed config options environment. (#2088)
    • docs(): Detailed config options environment.
    • Update README.md
  • Include axios-data-unpacker in ECOSYSTEM.md (#2080)
  • Allow opening examples in Gitpod (#1958)
  • Remove axios.all() and axios.spread() from Readme.md (#2727)
    • remove axios.all(), axios.spread()
    • replace example
    • axios.all() -> Promise.all()
    • axios.spread(function (acct, perms)) -> function (acct, perms)
    • add deprecated mark
  • Update README.md (#2887) Small change to the data attribute doc of the config. A request body can also be set for DELETE methods but this wasn't mentioned in the documentation (it only mentioned POST, PUT and PATCH). Took my some 10-20 minutes until I realized that I don't need to manipulate the request body with transformRequest in the case of DELETE.
  • Include swagger-taxos-codegen in ECOSYSTEM.md (#2162)
  • Add CDNJS version badge in README.md (#878) This badge will show the version on CDNJS!
  • Documentation update to clear up ambiguity in code examples (#2928)
    • Made an adjustment to the documentation to clear up any ambiguity around the use of "fs". This should help clear up that the code examples with "fs" cannot be used on the client side.
  • Update README.md about validateStatus (#2912) Rewrote the comment from "Reject only if the status code is greater than or equal to 500" to "Resolve only if the status code is less than 500"
  • Updating documentation for usage form-data (#2805) Closes #2049
  • Fixing CHANGELOG.md issue link (#2784)
  • Include axios-hooks in ECOSYSTEM.md (#2003)
  • Added Response header access instructions (#1901)
    • Added Response header access instructions
    • Added note about using bracket notation
  • Add onUploadProgress and onDownloadProgress are browser only (#2763) Saw in #928 and #1966 that onUploadProgress and onDownloadProgress only work in the browser and was missing that from the README.
  • Update ' sign to ` in proxy spec (#2778)
  • Adding jsDelivr link in README (#1110)
    • Adding jsDelivr link
    • Add SRI
    • Remove SRI

Huge thanks to everyone who contributed to this release via code (authors listed below) or via reviews and triaging on GitHub:

0.19.2 (Jan 20, 2020)

  • Remove unnecessary XSS check (#2679) (see (#2646) for discussion)

0.19.1 (Jan 7, 2020)

Fixes and Functionality:

  • Fixing invalid agent issue (#1904)
  • Fix ignore set withCredentials false (#2582)
  • Delete useless default to hash (#2458)
  • Fix HTTP/HTTPs agents passing to follow-redirect (#1904)
  • Fix ignore set withCredentials false (#2582)
  • Fix CI build failure (#2570)
  • Remove dependency on is-buffer from package.json (#1816)
  • Adding options typings (#2341)
  • Adding Typescript HTTP method definition for LINK and UNLINK. (#2444)
  • Update dist with newest changes, fixes Custom Attributes issue
  • Change syntax to see if build passes (#2488)
  • Update Webpack + deps, remove now unnecessary polyfills (#2410)
  • Fix to prevent XSS, throw an error when the URL contains a JS script (#2464)
  • Add custom timeout error copy in config (#2275)
  • Add error toJSON example (#2466)
  • Fixing Vulnerability A Fortify Scan finds a critical Cross-Site Scrip… (#2451)
  • Fixing subdomain handling on no_proxy (#2442)
  • Make redirection from HTTP to HTTPS work (#2426) and (#2547)
  • Add toJSON property to AxiosError type (#2427)
  • Fixing socket hang up error on node side for slow response. (#1752)
  • Alternative syntax to send data into the body (#2317)
  • Fixing custom config options (#2207)
  • Fixing set config.method after mergeConfig for Axios.prototype.request (#2383)
  • Axios create url bug (#2290)
  • Do not modify config.url when using a relative baseURL (resolves #1628) (#2391)

Internal:

  • Revert "Update Webpack + deps, remove now unnecessary polyfills" (#2479)
  • Order of if/else blocks is causing unit tests mocking XHR. (#2201)
  • Add license badge (#2446)
  • Fix travis CI build #2386
  • Fix cancellation error on build master. #2290 #2207 (#2407)

Documentation:

  • Fixing typo in CHANGELOG.md: s/Functionallity/Functionality (#2639)
  • Fix badge, use master branch (#2538)
  • Fix typo in changelog #2193
  • Document fix (#2514)
  • Update docs with no_proxy change, issue #2484 (#2513)
  • Fixing missing words in docs template (#2259)
  • 🐛Fix request finally documentation in README (#2189)
  • updating spelling and adding link to docs (#2212)
  • docs: minor tweak (#2404)
  • Update response interceptor docs (#2399)
  • Update README.md (#2504)
  • Fix word 'sintaxe' to 'syntax' in README.md (#2432)
  • updating README: notes on CommonJS autocomplete (#2256)
  • Fix grammar in README.md (#2271)
  • Doc fixes, minor examples cleanup (#2198)

0.19.0 (May 30, 2019)

Fixes and Functionality:

  • Added support for no_proxy env variable (#1693) - Chance Dickson
  • Unzip response body only for statuses != 204 (#1129) - drawski
  • Destroy stream on exceeding maxContentLength (fixes #1098) (#1485) - Gadzhi Gadzhiev
  • Makes Axios error generic to use AxiosResponse (#1738) - Suman Lama
  • Fixing Mocha tests by locking follow-redirects version to 1.5.10 (#1993) - grumblerchester
  • Allow uppercase methods in typings. (#1781) - Ken Powers
  • Fixing building url with hash mark (#1771) - Anatoly Ryabov
  • This commit fix building url with hash map (fragment identifier) when parameters are present: they must not be added after #, because client cut everything after #
  • Preserve HTTP method when following redirect (#1758) - Rikki Gibson
  • Add getUri signature to TypeScript definition. (#1736) - Alexander Trauzzi
  • Adding isAxiosError flag to errors thrown by axios (#1419) - Ayush Gupta

Internal:

  • Fixing .eslintrc without extension (#1789) - Manoel
  • Fix failing SauceLabs tests by updating configuration - Emily Morehouse
  • Add issue templates - Emily Morehouse

Documentation:

  • Consistent coding style in README (#1787) - Ali Servet Donmez
  • Add information about auth parameter to README (#2166) - xlaguna
  • Add DELETE to list of methods that allow data as a config option (#2169) - Daniela Borges Matos de Carvalho
  • Update ECOSYSTEM.md - Add Axios Endpoints (#2176) - Renan
  • Add r2curl in ECOSYSTEM (#2141) - 유용우 / CX
  • Update README.md - Add instructions for installing with yarn (#2036) - Victor Hermes
  • Fixing spacing for README.md (#2066) - Josh McCarty
  • Update README.md. - Change .then to .finally in example code (#2090) - Omar Cai
  • Clarify what values responseType can have in Node (#2121) - Tyler Breisacher
  • docs(ECOSYSTEM): add axios-api-versioning (#2020) - Weffe
  • It seems that responseType: 'blob' doesn't actually work in Node (when I tried using it, response.data was a string, not a Blob, since Node doesn't have Blobs), so this clarifies that this option should only be used in the browser
  • Update README.md. - Add Querystring library note (#1896) - Dmitriy Eroshenko
  • Add react-hooks-axios to Libraries section of ECOSYSTEM.md (#1925) - Cody Chan
  • Clarify in README that default timeout is 0 (no timeout) (#1750) - Ben Standefer

0.19.0-beta.1 (Aug 9, 2018)

NOTE: This is a beta version of this release. There may be functionality that is broken in certain browsers, though we suspect that builds are hanging and not erroring. See https://saucelabs.com/u/axios for the most up-to-date information.

New Functionality:

  • Add getUri method (#1712)
  • Add support for no_proxy env variable (#1693)
  • Add toJSON to decorated Axios errors to facilitate serialization (#1625)
  • Add second then on axios call (#1623)
  • Typings: allow custom return types
  • Add option to specify character set in responses (with http adapter)

Fixes:

  • Fix Keep defaults local to instance (#385)
  • Correctly catch exception in http test (#1475)
  • Fix accept header normalization (#1698)
  • Fix http adapter to allow HTTPS connections via HTTP (#959)
  • Fix Removes usage of deprecated Buffer constructor. (#1555, #1622)
  • Fix defaults to use httpAdapter if available (#1285)
    • Fixing defaults to use httpAdapter if available
    • Use a safer, cross-platform method to detect the Node environment
  • Fix Reject promise if request is cancelled by the browser (#537)
  • [Typescript] Fix missing type parameters on delete/head methods
  • [NS]: Send false flag isStandardBrowserEnv for Nativescript
  • Fix missing type parameters on delete/head
  • Fix Default method for an instance always overwritten by get
  • Fix type error when socketPath option in AxiosRequestConfig
  • Capture errors on request data streams
  • Decorate resolve and reject to clear timeout in all cases

Huge thanks to everyone who contributed to this release via code (authors listed below) or via reviews and triaging on GitHub:

0.18.0 (Feb 19, 2018)

  • Adding support for UNIX Sockets when running with Node.js (#1070)
  • Fixing typings (#1177):
    • AxiosRequestConfig.proxy: allows type false
    • AxiosProxyConfig: added auth field
  • Adding function signature in AxiosInstance interface so AxiosInstance can be invoked (#1192, #1254)
  • Allowing maxContentLength to pass through to redirected calls as maxBodyLength in follow-redirects config (#1287)
  • Fixing configuration when using an instance - method can now be set (#1342)

0.17.1 (Nov 11, 2017)

  • Fixing issue with web workers (#1160)
  • Allowing overriding transport (#1080)
  • Updating TypeScript typings (#1165, #1125, #1131)

0.17.0 (Oct 21, 2017)

  • BREAKING Fixing issue with baseURL and interceptors (#950)
  • BREAKING Improving handing of duplicate headers (#874)
  • Adding support for disabling proxies (#691)
  • Updating TypeScript typings with generic type parameters (#1061)

0.16.2 (Jun 3, 2017)

  • Fixing issue with including buffer in bundle (#887)
  • Including underlying request in errors (#830)
  • Convert method to lowercase (#930)

0.16.1 (Apr 8, 2017)

  • Improving HTTP adapter to return last request in case of redirects (#828)
  • Updating follow-redirects dependency (#829)
  • Adding support for passing Buffer in node (#773)

0.16.0 (Mar 31, 2017)

  • BREAKING Removing Promise from axios typings in favor of built-in type declarations (#480)
  • Adding options shortcut method (#461)
  • Fixing issue with using responseType: 'json' in browsers incompatible with XHR Level 2 (#654)
  • Improving React Native detection (#731)
  • Fixing combineURLs to support empty relativeURL (#581)
  • Removing PROTECTION_PREFIX support (#561)

0.15.3 (Nov 27, 2016)

  • Fixing issue with custom instances and global defaults (#443)
  • Renaming axios.d.ts to index.d.ts (#519)
  • Adding get, head, and delete to defaults.headers (#509)
  • Fixing issue with btoa and IE (#507)
  • Adding support for proxy authentication (#483)
  • Improving HTTP adapter to use http protocol by default (#493)
  • Fixing proxy issues (#491)

0.15.2 (Oct 17, 2016)

  • Fixing issue with calling cancel after response has been received (#482)

0.15.1 (Oct 14, 2016)

  • Fixing issue with UMD (#485)

0.15.0 (Oct 10, 2016)

  • Adding cancellation support (#452)
  • Moving default adapter to global defaults (#437)
  • Fixing issue with file URI scheme (#440)
  • Fixing issue with params objects that have no prototype (#445)

0.14.0 (Aug 27, 2016)

  • BREAKING Updating TypeScript definitions (#419)
  • BREAKING Replacing agent option with httpAgent and httpsAgent (#387)
  • BREAKING Splitting progress event handlers into onUploadProgress and onDownloadProgress (#423)
  • Adding support for http_proxy and https_proxy environment variables (#366)
  • Fixing issue with auth config option and Authorization header (#397)
  • Don't set XSRF header if xsrfCookieName is null (#406)

0.13.1 (Jul 16, 2016)

  • Fixing issue with response data not being transformed on error (#378)

0.13.0 (Jul 13, 2016)

  • BREAKING Improved error handling (#345)
  • BREAKING Response transformer now invoked in dispatcher not adapter (10eb238)
  • BREAKING Request adapters now return a Promise (157efd5)
  • Fixing issue with withCredentials not being overwritten (#343)
  • Fixing regression with request transformer being called before request interceptor (#352)
  • Fixing custom instance defaults (#341)
  • Fixing instances created from axios.create to have same API as default axios (#217)

0.12.0 (May 31, 2016)

  • Adding support for URLSearchParams (#317)
  • Adding maxRedirects option (#307)

0.11.1 (May 17, 2016)

  • Fixing IE CORS support (#313)
  • Fixing detection of FormData (#325)
  • Adding Axios class to exports (#321)

0.11.0 (Apr 26, 2016)

  • Adding support for Stream with HTTP adapter (#296)
  • Adding support for custom HTTP status code error ranges (#308)
  • Fixing issue with ArrayBuffer (#299)

0.10.0 (Apr 20, 2016)

  • Fixing issue with some requests sending undefined instead of null (#250)
  • Fixing basic auth for HTTP adapter (#252)
  • Fixing request timeout for XHR adapter (#227)
  • Fixing IE8 support by using onreadystatechange instead of onload (#249)
  • Fixing IE9 cross domain requests (#251)
  • Adding maxContentLength option (#275)
  • Fixing XHR support for WebWorker environment (#279)
  • Adding request instance to response (#200)

0.9.1 (Jan 24, 2016)

  • Improving handling of request timeout in node (#124)
  • Fixing network errors not rejecting (#205)
  • Fixing issue with IE rejecting on HTTP 204 (#201)
  • Fixing host/port when following redirects (#198)

0.9.0 (Jan 18, 2016)

  • Adding support for custom adapters
  • Fixing Content-Type header being removed when data is false (#195)
  • Improving XDomainRequest implementation (#185)
  • Improving config merging and order of precedence (#183)
  • Fixing XDomainRequest support for only <= IE9 (#182)

0.8.1 (Dec 14, 2015)

  • Adding support for passing XSRF token for cross domain requests when using withCredentials (#168)
  • Fixing error with format of basic auth header (#178)
  • Fixing error with JSON payloads throwing InvalidStateError in some cases (#174)

0.8.0 (Dec 11, 2015)

  • Adding support for creating instances of axios (#123)
  • Fixing http adapter to use Buffer instead of String in case of responseType === 'arraybuffer' (#128)
  • Adding support for using custom parameter serializer with paramsSerializer option (#121)
  • Fixing issue in IE8 caused by forEach on arguments (#127)
  • Adding support for following redirects in node (#146)
  • Adding support for transparent decompression if content-encoding is set (#149)
  • Adding support for transparent XDomainRequest to handle cross domain requests in IE9 (#140)
  • Adding support for HTTP basic auth via Authorization header (#167)
  • Adding support for baseURL option (#160)

0.7.0 (Sep 29, 2015)

  • Fixing issue with minified bundle in IE8 (#87)
  • Adding support for passing agent in node (#102)
  • Adding support for returning result from axios.spread for chaining (#106)
  • Fixing typescript definition (#105)
  • Fixing default timeout config for node (#112)
  • Adding support for use in web workers, and react-native (#70), (#98)
  • Adding support for fetch like API axios(url[, config]) (#116)

0.6.0 (Sep 21, 2015)

  • Removing deprecated success/error aliases
  • Fixing issue with array params not being properly encoded (#49)
  • Fixing issue with User-Agent getting overridden (#69)
  • Adding support for timeout config (#56)
  • Removing es6-promise dependency
  • Fixing issue preventing length to be used as a parameter (#91)
  • Fixing issue with IE8 (#85)
  • Converting build to UMD

0.5.4 (Apr 08, 2015)

  • Fixing issue with FormData not being sent (#53)

0.5.3 (Apr 07, 2015)

  • Using JSON.parse unconditionally when transforming response string (#55)

0.5.2 (Mar 13, 2015)

  • Adding support for statusText in response (#46)

0.5.1 (Mar 10, 2015)

  • Fixing issue using strict mode (#45)
  • Fixing issue with standalone build (#47)

0.5.0 (Jan 23, 2015)

  • Adding support for intercepetors (#14)
  • Updating es6-promise dependency

0.4.2 (Dec 10, 2014)

  • Fixing issue with Content-Type when using FormData (#22)
  • Adding support for TypeScript (#25)
  • Fixing issue with standalone build (#29)
  • Fixing issue with verbs needing to be capitalized in some browsers (#30)

0.4.1 (Oct 15, 2014)

  • Adding error handling to request for node.js (#18)

0.4.0 (Oct 03, 2014)

  • Adding support for ArrayBuffer and ArrayBufferView (#10)
  • Adding support for utf-8 for node.js (#13)
  • Adding support for SSL for node.js (#12)
  • Fixing incorrect Content-Type header (#9)
  • Adding standalone build without bundled es6-promise (#11)
  • Deprecating success/error in favor of then/catch

0.3.1 (Sep 16, 2014)

  • Fixing missing post body when using node.js (#3)

0.3.0 (Sep 16, 2014)

  • Fixing success and error to properly receive response data as individual arguments (#8)
  • Updating then and catch to receive response data as a single object (#6)
  • Fixing issue with all not working (#7)

0.2.2 (Sep 14, 2014)

  • Fixing bundling with browserify (#4)

0.2.1 (Sep 12, 2014)

  • Fixing build problem causing ridiculous file sizes

0.2.0 (Sep 12, 2014)

  • Adding support for all and spread
  • Adding support for node.js (#1)

0.1.0 (Aug 29, 2014)

  • Initial release