gc-ajax-plugin is a gremlin-console plugin that loads an http page rather than connecting directly to gremlin-server via websockets. This allows users to handle authentication and authorization on the server end.
npm install gc-ajax-plugin
;;//create a console + input combo by passing css selectors to GremlinConsole//Loadconst gc =;gc; //register the plugin
It is not recomended that you do this as this is relatively heavy.
gc-ajax-plugin will contain duplicate dependencies (though they shouldn't conflict). However it is a possible use case.
<!-- ... -->
//create a console + input combo by passing css selectors to GremlinConsole//Loadvar gc = GremlinConsole;gc; //register the plugin
It is the User's responsibility to set up the appropriate web page for the console to connect to. You can do any Authentication or Authorization you may require here.
In the examples above the console will send
POST requests to
http://localhost:80/my/path. These requests will provide the following form data :
stringcontaining the gremlin query.
arraycontaining bindings for the query. You can pretty much ignore this unless you are doing some really low level calls against the
In return the console expects to receive a
gremlin-server response (
GraphSON format) as a string (full result, no streaming supported at the moment).
Note: It may be required for you to set the following header for your response:
You can use this plugin along side other plugins (such as the text output plugin). Just be wary of the registration order. You'll want to register this plugin before the others