Skip to main content

The Giraffe Javascript SDK

Build your own extensions for Giraffe

J
Written by John Asher
Updated over 3 weeks ago

The Giraffe Javascript SDK allows developers to write custom web apps that extend the functionality of Giraffe.

Background on Apps

Apps can make designing and developing cities more fun, fast and collaborative. Giraffe comes with a number of apps built in, but we've only scratched the surface of what's possible.

To empower technical developers and reduce the cost of deploying business grade custom software, we've released a new Javascript SDK . This allows (web) developers to connect their own web app to the Giraffe platform. They can leverage Giraffe authentication, hosting, geometries, layers and more to get from prototype to production faster.

Apps can read and write data from the Giraffe map such as geometries, layers and UI state (eg a user’s current selection). An app is rendered in an Iframe on the right of the screen. It can interact with other areas of Giraffe through the SDK functions.

The Giraffe JS SDK is modelled around GeoJSON, because we believe simple formats like this drive automation and interesting analysis.

There are two ways to call the same set of SDK functions - the Iframe Post-message SDK and the Console JS SDK. Both of these will rapidly expand Giraffe’s analytics capacity.

Iframe Post-message SDK

  • custom app deployed and owned by you but with UI appearing in Giraffe

  • combine Giraffe’s features with your own APIs, data or workflows

Console JS SDK - examples

  • one off custom workflows/automations

    • eg import a csv of points, join to cadastre boundaries, save as projects

  • advanced GIS consulting eg MCS, without leaving the browser

  • prototyping algorithms for apps

We’ve had several attempts at helping users run their own code in Giraffe. Our pub/sub API is still used by some to interact live with Grasshopper. We have several apps built by customers with our first javascript SDK running in their Giraffe workspaces. We liked the idea of something like Bit tried module federation. However, these approaches all require significant technical setup. So we’ve gone a simpler route.

Did this answer your question?