-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(docs): init commit getting things setup
- Loading branch information
Showing
9 changed files
with
247 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
.cache/ | ||
public/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
const themeOptions = require('@availity/gatsby-theme/theme-options'); | ||
|
||
module.exports = { | ||
pathPrefix: '/sdk-js', | ||
__experimentalThemes: [ | ||
{ | ||
resolve: '@availity/gatsby-theme', | ||
options: { | ||
...themeOptions, | ||
root: __dirname, | ||
subtitle: 'SDK Resources', | ||
description: 'Documentation for Resources', | ||
githubRepo: 'availity/sdk-js', | ||
sidebarCategories: { | ||
null: ['index', 'test'], | ||
Analytics: ['packages/analytics'], | ||
}, | ||
}, | ||
}, | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{ | ||
"private": true, | ||
"name": "@availity/docs", | ||
"version": "1.0.0", | ||
"license": "MIT", | ||
"keywords": [ | ||
"react", | ||
"availity" | ||
], | ||
"repository": { | ||
"type": "git", | ||
"url": "git+ssh://git@github.com/Availity/sdk-js.git" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/Availity/sdk-js/issues" | ||
}, | ||
"scripts": { | ||
"build": "gatsby build", | ||
"build:deploy": "gatsby build --prefix-paths", | ||
"start": "gatsby develop", | ||
"develop": "gatsby develop", | ||
"clean": "gatsby clean" | ||
}, | ||
"dependencies": { | ||
"@availity/analytics-core": "^2.7.2", | ||
"@availity/gatsby-theme": "^1.1.2", | ||
"gatsby": "^2.13.83", | ||
"react": "^16.8.3", | ||
"react-dom": "^16.8.3", | ||
"reactstrap": "^8.0.1" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
--- | ||
title: SDK | ||
summary: Javascript SDK for Availity | ||
--- | ||
|
||
[![License](https://img.shields.io/badge/license-MIT-blue.svg?style=for-the-badge&logo=MIT)](http://opensource.org/licenses/MIT) | ||
[![Dependency Status](https://img.shields.io/david/dev/Availity/sdk-js.svg?style=for-the-badge)](https://david-dm.org/Availity/sdk-js) | ||
[![Build](https://img.shields.io/travis/Availity/sdk-js.svg?style=for-the-badge&label=build)](https://travis-ci.org/Availity/sdk-js) | ||
|
||
## Supported Browsers | ||
|
||
- Internet Explorer 11 and newer | ||
- Google Chrome | ||
- Mozilla Firefox | ||
|
||
## Documentation | ||
|
||
- [analytics-angular](packages/analytics-core/README.md) - Analytics core logic and auto-tracking. | ||
- [api-core](packages/api-core/README.md) - Base API definitions used by [api-axios](packages/api-axios/README.md) and [api-angular](api-angular/README.md) for the Availity REST API. | ||
- [api-axios](packages/api-axios/README.md) - A package wrapping [@av/api-core](../api-core/README.md) with [axios](https://github.com/axios/axios) and native ES6 Promise. | ||
- [api-angular](packages/api-angular/README.md) - A package wrapping [@av/api-core](../api-core/README.md) with Angular `$http`. | ||
- [localalstorage-core](packages/localstorage-core/README.md) - Wraps localStorage with utility functions. | ||
- [message-core](packages/message-core/README.md) - Wraps postMessage function with helper functions and security checks. | ||
- [upload-core](packages/upload-core/README.md) - > Wrapper for tus-js-client | ||
- [dl-core](packages/dl-core/README.md) - > Wrapper for js-file-download | ||
|
||
## Adding a new API Resource | ||
|
||
1. Run `npm run new` | ||
2. Select the "api resource" template | ||
3. Follow the prompts | ||
|
||
## Contributing | ||
|
||
`skd-js` is a monorepo managed using [lerna](https://github.com/lerna/lerna) in independent mode (each packages is versioned and published individually). | ||
|
||
- Run `npm install` | ||
- Commits should use the [Angular Commit Format](https://github.com/angular/angular.js/blob/master/DEVELOPERS.md#type). Scope should one of un-prefixed name of the packages under `./packages/`. If a commit applies to multiple packages, leave out the scope. | ||
- Release and publish using `npm run release`. The version is determined by analyzing the commit messages. | ||
|
||
> Preview how lerna will version the packages by running: | ||
```shell | ||
npx lerna version --no-git-tag-version --no-push | ||
``` | ||
|
||
> Determine why lerna choose a semver version for the packages by running: | ||
```shell | ||
npx lerna version --no-git-tag-version --no-push --loglevel silly | ||
``` | ||
|
||
## License | ||
|
||
[MIT](./LICENSE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,130 @@ | ||
--- | ||
title: Analytics | ||
summary: A package providing a base Analytics class to track events and page views | ||
--- | ||
|
||
[![Version](https://img.shields.io/npm/v/@availity/analytics-core.svg?style=for-the-badge)](https://www.npmjs.com/package/@availity/analytics-core) | ||
|
||
## Install | ||
`npm install @availity/analytics-core` | ||
|
||
## Configuration | ||
|
||
`AvAnalytics` requires Plugins and a Promise lib. | ||
|
||
```javascript | ||
new AvAnalytics(plugins, promise); | ||
``` | ||
|
||
`AvAnalytics` also has an optional 3rd parameter, a boolean to determine if pageTracking is enabled. | ||
For page tracking to be used, `startPageTracking` and `stopPageTracking` functions must be defined to create listeners and call `trackPageView`. | ||
`AvAnalytics` also has an optional 4th parameter, "autoTrack", a boolean which default to `true`. | ||
When `true`, "autoTrack" will be enabled which will automatically log | ||
|
||
```javascript | ||
new AvAnalytics(plugins, promise, pageTracking, autoTrack, options); | ||
``` | ||
|
||
### Options | ||
- **attributePrefix** string. Overrides the default prefix for getting attributes. | ||
- **recursive** boolean. If `true`, will add on all attributes from the clicke/focused node up to the root element. It requires one attribute to have contain `action`. | ||
|
||
Example using the `recursive` option ( Will add all 3 attributes when the `anchor` tag is clicked. If the container is clicked nothing will happen ): | ||
```html | ||
<div class="container" data-analytics-app-name="app"> | ||
<a href="#" data-analytics-action="click" data-analytics-event-name="linking">Click me!</a> | ||
</div> | ||
``` | ||
|
||
## Plugins | ||
|
||
Plugins can be one or an array of objects/classes: | ||
|
||
A default class with functions defined and enabled logic is provided `AvAnalyticsPlugin`. | ||
|
||
```javascript | ||
import {AvAnalyticsPlugin} from '@availity/analytics-core'; | ||
``` | ||
|
||
### Plugin Methods | ||
|
||
the functions/properties used by `AvAnalytics` are: | ||
|
||
#### isEnabled | ||
Determines if this plugin will be called at various points. | ||
If this is a function, the return value will be used. Otherwise will be checked as boolean. | ||
|
||
#### init | ||
|
||
if defined, will be called when `AvAnalytics` is initialized. | ||
|
||
#### trackEvent | ||
|
||
if defined, called when `AvAnalytics` receives a trackEvent call. | ||
|
||
#### trackPageView | ||
|
||
if defined, called when `AvAnalytics` receives a trackPageView call. | ||
|
||
### Defined Plugins | ||
|
||
#### AvSplunkAnalytics | ||
|
||
`AvSplunkAnalytics` is a plugin to track events with the `AvLogMessages` api. | ||
It defaults the url and level before sending. | ||
|
||
```javascript | ||
import {AvSplunkAnalytics} from '@availity/analytics-core'; | ||
|
||
const exampleSplunkAnalytics = new AvSplunkAnalytics(new AvLogMessages({ http, promise, merge }), isEnabled); | ||
``` | ||
|
||
## Methods | ||
|
||
### `init()` | ||
|
||
Initialize analytics pageTracking and plugins | ||
|
||
### `setPageTracking(value)` | ||
|
||
use parameter to set turn page tracking on/off. Always checks that pageTracking has been set up or torn down as needed. | ||
|
||
### `trackEvent(properties)` | ||
|
||
Send properties to each plugins `trackEvent` function. | ||
|
||
### `trackPageView(url)` | ||
|
||
Send url or `location.href` to each plugins `trackEvent` function. | ||
|
||
## AutoTrack Logged events | ||
With "autoTrack" enabled (enabled by default) you can add special `data-analytics-*` to any element which will be rendered to the DOM. | ||
For native form elements (input, select, and textarea) with the special attribute, `focus` and `blur` events will trigger analytics to be logged. | ||
For all other element with the special attribute, `click` events will trigger analytics to be logged. | ||
You can have as many of the `data-analytics-*` attributes on an element as you which, all of the properties will be logged with the `data-analytics-` prefix removed and the remaining camelcased as the key and the value of the attribute as the logged value. | ||
This works with all libraries such as angular, react, jquery, and pure HTML. | ||
|
||
```jsx | ||
<a | ||
href="/some-place-cool" | ||
data-analytics-variation="b" | ||
data-analytics-organization-id={orgId} | ||
data-analytics-page-num={currentPage}> | ||
Go there now! | ||
</a> | ||
``` | ||
|
||
```jsx | ||
import { Input } from 'reactstrap'; | ||
//... | ||
<Input | ||
data-analytics-variation="b" | ||
data-analytics-organization-id={orgId} /> | ||
``` | ||
|
||
## Authors | ||
**Kasey Powers** | ||
* [kaseyepowers@gmail.com](kaseyepowers@gmail.com) | ||
|
||
## License | ||
[MIT](../../LICENSE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
title: SDK Mdx | ||
summary: Javascript SDK for Availity | ||
--- | ||
|
||
Testing |