# Embedding Reference Universe with MKWS ## Quick start Simply paste this inline with the markup on any page:
## A bit more detail The MasterKey Widget Set ([MKWS](http://mkws.indexdata.com/)) lets you easily embed search-enabled widgets which run in the client browser and display results from a web service. In this case, it searches Reference Universe. You need to include the main MKWS scripts. This can be inline as above or you can include it in the header or aggregate it with your application's scripts. You also need to tell the widget how to authenticate onto the searching service: The provided stylesheet is generic and you're encouraged to replace it entirely by styling the new elements to fit seamlessly with your content. Any element you give the class `mkws-reference-universe` will have is contents replaced by the top results from a search against the Reference Universe service for the current query.
### Finding the query The `autosearch` attribute of the widget container lets it know where to find the query. There are three places it might look to find that you're searching for *water*: * `!param!foo` indicates a GET parameter and would match `http://site.tld/search?foo=water` * `!path!2` will take the 2nd path component from the end of the url and would find the query in `http://site.tld/apps/search/water/mobile` * `!var!foo` will look for the query in a JavaScript variable named `foo` in the `window` context (ie. a top level variable)