Skip to content

Commit 27df671

Browse files
committed
add warning about unversioned cdn urls
1 parent 5ee0dd4 commit 27df671

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,8 @@ The package has different entry points for different environments. The browser e
131131
<script src="https://unpkg.com/@optimizely/optimizely-sdk@6/dist/optimizely.browser.umd.js"></script>
132132
```
133133

134+
> ⚠️ **Warning**: Always specify a version when using CDN URLs like `unpkg` URLs above (for example: `@6` in the examples above). Using unversioned CDN URLs can automatically pull in breaking changes when new versions are released, causing unexpected problems in the application.
135+
134136
When evaluated, that bundle assigns the SDK's exports to `window.optimizelySdk`. If you wish to use the asset locally (for example, if unpkg is down), you can find it in your local copy of the package at dist/optimizely.browser.umd.min.js. We do not recommend using this method in production settings as it introduces a third-party performance dependency.
135137

136138
As `window.optimizelySdk` should be a global variable at this point, you can continue to use it like so:

0 commit comments

Comments
 (0)