Skip to content

Commit

Permalink
2.3.8 - downgrade to core-js@2 until zloirock/core-js#513 is sorted
Browse files Browse the repository at this point in the history
  • Loading branch information
klarstrup committed Mar 27, 2019
1 parent 46c6537 commit 3fd5252
Show file tree
Hide file tree
Showing 5 changed files with 155 additions and 113 deletions.
36 changes: 25 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ This SDK works both client-side in your browser but also server-side in a Node.j

First, you need to [create a ShopGun app](https://shopgun.com/developers/apps) allowing you to make API requests. You will be prompted to create a new user first.

> We recommend creating 2 apps: 1 for production and another for development. This ensures environments aren't mixed.
> We recommend creating 2 apps: 1 for production and another for development. This ensures environments aren't mixed.
## Setup

Expand All @@ -18,8 +18,17 @@ First, you need to [create a ShopGun app](https://shopgun.com/developers/apps) a
The SDK makes use of both JavaScript and CSS so you need to load two resources in the browser:

```html
<link href="https://d21oefkcnoen8i.cloudfront.net/sgn-sdk-2.3.6.min.css" rel="stylesheet" type="text/css">
<script src="https://d21oefkcnoen8i.cloudfront.net/sgn-sdk-2.3.6.min.js" id="sgn-sdk" data-app-key="YOUR_APP_KEY" data-track-id="YOUR_TRACK_ID"></script>
<link
href="https://d21oefkcnoen8i.cloudfront.net/sgn-sdk-2.3.6.min.css"
rel="stylesheet"
type="text/css"
/>
<script
src="https://d21oefkcnoen8i.cloudfront.net/sgn-sdk-2.3.6.min.js"
id="sgn-sdk"
data-app-key="YOUR_APP_KEY"
data-track-id="YOUR_TRACK_ID"
></script>
```

By defining your app key and track identifier as data attributes when including the JavaScript file the SDK auto-configures itself. You can find the app key and track identifier in the [developer console](https://shopgun.com/developers/apps).
Expand All @@ -38,17 +47,17 @@ When installed you can require and configure the SDK:
SGN = require('sgn-sdk');

SGN.config.set({
appKey: 'YOUR_APP_KEY',
appSecret: 'YOUR_APP_SECRET'
appKey: 'YOUR_APP_KEY',
appSecret: 'YOUR_APP_SECRET'
});
```

We recommend using environment variables for the config to avoid having secrets in your code base:

```javascript
SGN.config.set({
appKey: process.env.SHOPGUN_APP_KEY,
appSecret: process.env.SHOPGUN_APP_SECRET
appKey: process.env.SHOPGUN_APP_KEY,
appSecret: process.env.SHOPGUN_APP_SECRET
});
```

Expand All @@ -60,12 +69,17 @@ To provide your users with a viewing experience for PDF's you need to use our Pa

To learn more about integrating the same experience on iOS and Android be sure to check out the respective SDK's:

* [ShopGun iOS SDK](https://github.com/shopgun/shopgun-ios-sdk)
* [ShopGun Android SDK](https://github.com/shopgun/shopgun-android-sdk)
- [ShopGun iOS SDK](https://github.com/shopgun/shopgun-ios-sdk)
- [ShopGun Android SDK](https://github.com/shopgun/shopgun-android-sdk)

## Changelog

### Version 2.3.8

- Roll back to core-js 2

### Version 2.3.7

- Update verso-browser and incito-browser
- Fix an issue where polyfills were missing

Expand Down Expand Up @@ -114,8 +128,8 @@ To learn more about integrating the same experience on iOS and Android be sure t
### Version 2.0.0

- PagedPublicationKit
- Refactored `SGN.PagedPublicationKit.initialize` to `SGN.PagedPublication.Bootstrapper` to split fetching and rendering of the viewer
- Made hotspots into a function instead of having a setting called `showHotspots`
- Refactored `SGN.PagedPublicationKit.initialize` to `SGN.PagedPublication.Bootstrapper` to split fetching and rendering of the viewer
- Made hotspots into a function instead of having a setting called `showHotspots`
- Introduced IncitoPublicationKit
- Removed unused files
- Fixed incorrect positioning of hotspots and hotspot picker in Internet Explorer
Expand Down
29 changes: 14 additions & 15 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
const presets = [
[
'@babel/preset-env',
{
targets: {
browsers: ['> 3%', 'IE 11'],
node: 8
},
corejs: 3,
useBuiltIns: 'usage'
}
]
];

module.exports = {
presets
presets: [
[
'@babel/preset-env',
{
targets: {
browsers: ['> 3%', 'IE 11'],
node: 8
},
corejs: 2,
useBuiltIns: 'usage',
exclude: ['transform-typeof-symbol']
}
]
]
};
Loading

0 comments on commit 3fd5252

Please sign in to comment.