Cozy Bar Library
Cozy is a platform that brings all your web services in the same private space. With it, your webapps and your devices can share data easily, providing you with a new experience. You can install Cozy on your own hardware where no one's tracking you.
cozy-bar.js
is a javascript library made by Cozy. It enables the CozyBar component in your application. This component is a banner on the top of your application, responsible of cross-apps navigation, user facilities, intents, etc.
cozy-bar.js
is an asset directly served by the cozy-stack. To use it, simply add <script src="/js/cozy-bar.js" defer></script>
in the <head>
section of the index.html
of your application. It exposes an API behind the window.cozy.bar
namespace, that let you interact with the CozyBar itself.
The library requires your markup to contain an element with role=application
and attributes data-cozy-domain
and data-cozy-token
. The DOM of the banner will be added before this element.
Once you have the library included in your application, starts by intialize it in your app bootstrap:
window.cozy.bar.init({
appName: MY_APP_NAME,
appEditor: APP_EDITOR
iconPath: PATH_TO_SVG_ICON,
lang: LOCALE
})
appName
param in hash is mandatory when appEditor
, lang
and iconPath
are optionals. If not passed, their values are detected into the DOM:
appEditor
is extracted from the manifest. Originally used for apps maintained by Cozy Cloud teams.lang
is extracted from thelang
attribute of the<html>
tag. Defaults to 'en'iconPath
uses the favicon 32px. Defaults to a blank GIF
Help link is defined in your Cozy's configuration file, in the context
section. See the cozy.example.yaml
file provided by the stack.
Coming Soon applications (or apps) are defined in your Cozy's configuration file. See the cozy.example.yaml
file provided by the stack.
Claudy actions are declared in src/config/claudy.yaml
with a slug as property name and some options (icon name and link options for example). The slugs list that will be used for Claudy is defined in your Cozy's configuration file. See the cozy.example.yaml
file provided by the stack.
If no claudy_actions
property is defined in the configuration, Claudy won't be displayed.
If you want to work on cozy-client-js itself and submit code modifications, feel free to open pull-requests! See the contributing guide for more information about this repository structure, testing, linting and how to properly open pull-requests.
The lead maintainer for cozy-bar.js is @m4dz, send him/her a 🍻 to say hello!
You can reach the Cozy Community by:
- Chatting with us on IRC #cozycloud on Freenode
- Posting on our Forum
- Posting issues on the Github repos
- Say Hi! on Twitter
cozy-bar.js is developed by Cozy Cloud and distributed under the MIT.