# newbie preferences question

**URL:** <https://forums.plex.tv/t/newbie-preferences-question/34299>\
**Category:** Dev/API Corner\
**Tags:** plugin-dev\
**Created:** [May 15, 2013, 2:51am UTC](https://forums.plex.tv/t/newbie-preferences-question/34299 "2013-05-15T02:51:47Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![gb01](https://avatars.discourse-cdn.com/v4/letter/g/97f17d/32.png) [@gb01](https://forums.plex.tv/u/gb01)\
**Post date:** [May 15, 2013, 2:51am UTC](https://forums.plex.tv/t/newbie-preferences-question/34299/1 "2013-05-15T02:51:47Z")

</div>

How does a developer specify what preferences they want to store?&nbsp; Been searching the documentation and found how to set the defaults using the JSON preferences file.&nbsp; But the plug-ins I'm working with do not use a preferences file yet have their own custom preferences.&nbsp; I can see in the code where those plug-ins read the preferences but not where they define them.

&nbsp;

There is an older forum entry that said to use Prefs.add(....) but I don't see that in the current documentation nor do the plug-ins I'm using as examples use that.

&nbsp;

Feel like I'm missing something very basic.&nbsp; Any help is appreciated.

---

<div class="post-metadata">

**Author:** ![sander1](https://avatars.discourse-cdn.com/v4/letter/s/4bbf92/32.png) [@sander1](https://forums.plex.tv/u/sander1)\
**Post date:** [May 15, 2013, 9:57am UTC](https://forums.plex.tv/t/newbie-preferences-question/34299/2 "2013-05-15T09:57:11Z")

</div>

All preferences are declared in a JSON file with the name _DefaultPrefs.json_ if the file is part of the channel bundle. Example: [https://github.com/plexinc-plugins/Put.io.bundle/blob/master/Contents/DefaultPrefs.json](https://github.com/plexinc-plugins/Put.io.bundle/blob/master/Contents/DefaultPrefs.json)

If your channel makes use of a URL Service and the service and/or channel requires access to those preferences, you can make a _ServicePrefs.json_ file. Example: [https://github.com/plexinc-plugins/AmazonInstantVideo.bundle/blob/master/Contents/Services/URL/AmazonInstantVideo/ServicePrefs.json](https://github.com/plexinc-plugins/AmazonInstantVideo.bundle/blob/master/Contents/Services/URL/AmazonInstantVideo/ServicePrefs.json)

Prefs.add(...) is a very old way to declare preferences and is no longer being used.

---

<div class="post-metadata">

**Author:** ![gb01](https://avatars.discourse-cdn.com/v4/letter/g/97f17d/32.png) [@gb01](https://forums.plex.tv/u/gb01)\
**Post date:** [May 26, 2013, 6:03am UTC](https://forums.plex.tv/t/newbie-preferences-question/34299/3 "2013-05-26T06:03:57Z")

</div>

Thanks.&nbsp; So a follow up question...&nbsp; I'm making some changes to the YouTube plugin.&nbsp; It does not have a DefaultPrefs.json file nor a ServicePrefs.json file as part of the bundle.&nbsp; Yet it has preferences for region, a user ID and password.&nbsp; What am I missing?&nbsp; I can create a DefaultPrefs.json file but I'm thinking there must be something I need to do to undo about the current preferences setup.&nbsp;

---

<div class="post-metadata">

**Author:** ![sander1](https://avatars.discourse-cdn.com/v4/letter/s/4bbf92/32.png) [@sander1](https://forums.plex.tv/u/sander1)\
**Post date:** [May 26, 2013, 10:38am UTC](https://forums.plex.tv/t/newbie-preferences-question/34299/4 "2013-05-26T10:38:07Z")

</div>

> Thanks.&nbsp; So a follow up question...&nbsp; I'm making some changes to the YouTube plugin.&nbsp; It does not have a DefaultPrefs.json file nor a ServicePrefs.json file as part of the bundle.&nbsp; Yet it has preferences for region, a user ID and password.&nbsp; What am I missing?&nbsp; I can create a DefaultPrefs.json file but I'm thinking there must be something I need to do to undo about the current preferences setup.&nbsp;

URL Services can be included in a channel bundle, but they can also be placed inside _Services.bundle_. The services in the _Services.bundle_ can be used outside of channels, for example with the _Plex It!_ bookmarklet.

The YouTube service and preferences file are included in this Services bundle: [https://github.com/plexinc-plugins/Services.bundle/tree/master/Contents/Service%20Sets/com.plexapp.plugins.youtube/URL/YouTube](https://github.com/plexinc-plugins/Services.bundle/tree/master/Contents/Service%20Sets/com.plexapp.plugins.youtube/URL/YouTube)

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/plex/original/3X/2/a/2acb9765406f63293d357b4ec509ec39aa28f2ad.png) [@system](https://forums.plex.tv/u/system)\
**Post date:** [December 20, 2019, 11:21pm UTC](https://forums.plex.tv/t/newbie-preferences-question/34299/5 "2019-12-20T23:21:17Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
