
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
@amedia/gaia-client
Advanced tools
A node.js client for the Gaia REST service.
The methods in this client retrieve data from the endpoints in the Gaia REST service. Iow; one do need access to a running Gaia REST service.
$ npm install @amedia/gaia-client --save
Example on getting the property aid.use Object for www.ba.no:
const { GaiaClient } = require('gaia-client');
// use the HeaderManager from your app
const gaiaClient = new GaiaClient('http://varnish-local.api.no/gaia', {
headerManager,
});
gaiaClient
.getProperty('www.ba.no', 'aid.use')
.then((result) => console.log(result))
.catch((err) => console.error(err));
Take a look at bin/example.js for a simple script which uses all the methods of gaiaClient.
This constructs a new client:
const gaiaClient = new GaiaClient(urlRoot, { headerManager });
The constructor take the following parameters:
urlRoot is the url to the Gaia server you want to use. This should
be the hostname to the server without any paths. This parameter is required.options - config object. All options are optionaloptions.headerManager is the HeaderManager from your app. Default null.options.timeout Default 2000msoptions.agent is the http.Agent for the fetchOptions for gaia backend. Default undefinedoptions.keepAlive Keep alivie on the request. Default false.All methods returns a promise which resolve to an object.
If an error happens, either if the endpoint returns something else than 200 or the endpoint is not accessible, the Promise will be rejected with an error describing why.
The client has the following methods:
Retrieves the property with the given name from the publication with the given domain.
gaiaClient
.getProperty('www.tangotidende.no', 'shall.esi.be.used')
.then((result) => console.log(result['shall.esi.be.used']))
.catch((err) => console.error(err));
propertyNames is a list of names.
Retrieves the properties with the given names from the publication with the given domain. Returns a list of properties.
gaiaClient
.getProperties('www.tangotidende.no', [
'arena.design.version',
'custom.css.url.large',
])
.then((result) => console.log(result))
.catch((err) => console.error(err));
Retrieves the global property with the given name.
gaiaClient
.getGlobalProperty('castor.arena.version')
.then((result) => console.log(result))
.catch((err) => console.error(err));
Retrieves the footer for the publication.
gaiaClient
.getFooter('www.ba.no')
.then((result) => console.log(result))
.catch((err) => console.error(err));
Retrieves the menu for the publication.
gaiaClient
.getMenu('www.ba.no')
.then((result) => console.log(result))
.catch((err) => console.error(err));
$ npm test
Tests are written in Mocha.
The promise returned is no longer a Bluebird Promise. This means catch is no longer a filtered catch and the Promise does not support the spread method
We have a dedicated site-config module
All property methods return a key value map, not dictionary.
{
'aid.use': 'true'
}
not
[
{
value: 'true',
medusa: false,
overridable: false,
name: 'aid.use',
},
];
We have switched to the new v3 version of gaia API. The data structure for menu is changed.
FAQs
A [node.js][nodejs] client for the [Gaia][gaia] REST service.
The npm package @amedia/gaia-client receives a total of 236 weekly downloads. As such, @amedia/gaia-client popularity was classified as not popular.
We found that @amedia/gaia-client demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 71 open source maintainers 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.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.