
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
The JavaScript Carvoyant API for both the browser and Node.js. This library was created using the Carvoyant API Reference and as of writing this, this library has complete feature parity with the documented Carvoyant API Reference.
function (options, cb)
)deleteVehicle
API (Known Issue: Deleting a vehicle with any data will fail)Below are a list of known (as of this writing) issues/inconsistencies with the upstream Carvoyant API:
client.deleteVehicle
is implemented but the backend will not allow you to delete a vehicle with any data. This
means that while the API is there, it will likely fail until Carvoyant's APIs support it.Below are usage scenarios for both the browser and Node.js.
Browser support for the JavaScript Carvoyant API is provided by browserify. This offers a zero configuration deployment, meaning you do not need to download/install third party dependencies to get this library to work in a web browser. While using this library will be no different than usual, there are two versions of the file:
Installation can be as simple as downloading the proper JavaScript file into your project or installing it via Bower which is as simple as installing any other browser component using Bower:
bower install carvoyant --save
Now that you've installed it into your project, here is an example HTML snippet to get you started:
<!-- ... -->
<script src="bower_components/carvoyant/carvoyant.js"></script>
<!-- <script src="bower_components/carvoyant/carvoyant.min.js"></script> -->
<script>
// New style authentication/authorization
var client = carvoyant.createClient({accessToken: '...'});
// Old style authentication/authorization
// var client = carvoyant.createClient({apiKey: '...', securityToken: '...'});
</script>
<!-- ... -->
Installation is as simple as any other Node.js module using NPM:
npm install carvoyant --save
At this point, you can use the module like any other:
// New style authentication/authorization
var client = require('carvoyant').createClient({accessToken: '...'});
// Old (deprecated) style authentication/authorization
// var client = require('carvoyant').createClient({apiKey: '...', securityToken: '...'});
For more details on what APIs are available and how to use them, please use the source until I can get the items listed at the bottom of the page complete.
Below is a list of client configuration options:
As of 0.0.5, the preferred way to interact with the Carvoyant API is OAuth. The Carvoyant JavaScript API does not provide any of the OAuth facilities and requires you to give it an OAuth access token. The reason for this is that real OAuth typically has a user driven portion and for a JavaScript API, there's no guarantee that there will be facilities to support this process. For example, there is no bundled server component that would function as an OAuth callback to exchange an auth code for an access token. Even if there was, there'd be no way to ship that in the browser, a feature I've worked very hard to make possible.
All of that being said, you are responsible for obtaining the OAuth access token. The way I do this for development
is I created a Carvoyant Application and using that application, I will request an access
token in the browser using a URL like this:
https://auth.carvoyant.com/OAuth/authorize?client_id={applicationKey}&response_type=token&redirect_uri=noredirect
.
This URL will prompt you for your Carvoyant user credentials and once you successfully provide them, a nice UI will
display giving you your access token. I will then put that in my test/client_config.js
to run the test suite.
It's not ideal but this also isn't something that needs to be done a lot. It's also not something I can control.
Of course, for a real world application with a server-side component, you could do the full OAuth handshake process to do this in a more secure fashion. For more details on the OAuth implementation for the Carvoyant API, please view the Carvoyant OAuth Documentation.
This project uses best of breed libraries and tooling:
Right now the default Grunt command will run all tests (browser and Node.js) and create browser binaries for the
project. To do this, all you have to do is run grunt
from the command line, this of course assumes you installed
the project dependencies after cloning the repository using npm install
and that you've created a working
test/client_config.js
. (You can do this by copying test/client_config.js.tmpl
to test/client_config.js
and
updating accordingly) As of this time, unit tests and integration tests run together, there is no separation. Do
to the nature of the upstream Carvoyant API, this can leave behind created vehicles. You can clean these up from
the Carvoyant Dashboard.
Disclaimer
The way tests currently work right now is we create a vehicle and that vehicle is used for all tests where possible. Any write API we test will be against the created vehicle. We will never update an object we did not create as a part of our test. When you are done, the created vehicle will be left in your inventory due to a missing delete API.
There are a few tests that require us to use a vehicle id that already has data associated with it, due to us not
having APIs to create the data behind the APIs being tested. These cases are documented and handled in the
test/client_config.js
.
You can also generate JSDoc documentation using grunt jsdoc
. (This will eventually be
incorporated into the build/release cycle so we can host the API documentation online.)
FAQs
The Carvoyant API client library.
The npm package carvoyant receives a total of 0 weekly downloads. As such, carvoyant popularity was classified as not popular.
We found that carvoyant demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.