# MappedinEvent class - struggling to initiate properly

**URL:** <https://community.mappedin.com/t/mappedinevent-class-struggling-to-initiate-properly/130>\
**Category:** Mappedin JS\
**Created:** [September 4, 2024, 6:20pm UTC](https://community.mappedin.com/t/mappedinevent-class-struggling-to-initiate-properly/130 "2024-09-04T18:20:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![johnv](https://avatars.discourse-cdn.com/v4/letter/j/e47774/32.png) [@johnv](https://community.mappedin.com/u/johnv)\
**Post date:** [September 4, 2024, 6:20pm UTC](https://community.mappedin.com/t/mappedinevent-class-struggling-to-initiate-properly/130/1 "2024-09-04T18:20:50Z")

</div>

Hello,

I was looking at utilizing the MappedinEvents class but am struggling a bit on how to get the data. I was hoping you can help me with properly initializing this class?

Here is how i have it currently set up:

const mappedin = new Mappedin(options);  
const events = new MappedinEvent(mappedin, findLocations[0]);

findLocations[0] is a location object that has an event attached to it.

My set up is returning the location object as well as an empty start and end date, image, descrption, etc.

Tried following the docs but I think i am missing something!

Thank you for your time,  
John

---

<div class="post-metadata">

**Author:** ![msohm](https://yyz2.discourse-cdn.com/flex004/user_avatar/community.mappedin.com/msohm/32/6_2.png) [@msohm](https://community.mappedin.com/u/msohm)\
**Post date:** [September 5, 2024, 3:40pm UTC](https://community.mappedin.com/t/mappedinevent-class-struggling-to-initiate-properly/130/2 "2024-09-05T15:40:45Z")

</div>

Hi johnv,

Welcome to the Mappedin forum!

To reduce the amount of data downloaded with each map load, the Mappedin SDK has a default data set for commonly used features that it downloads with each request. Event data is not part of that default data set. To have it included, specify the event data type to be an additional `thing` that gets downloaded.

Here is an example of a [TGetVenueOptions](https://docs.mappedin.com/web-sdk-api/v5/latest/types/TGetVenueOptions.html) object that instructs the SDK to download events.

```auto
const options: TGetVenueOptions = {
  venue: "yourVenue",
  clientId: "yourClientId",
  clientSecret: "yourClientSecret",
  things: { events: ["event"] },
};

```

After making this change you should be able to access events.

---

<div class="post-metadata">

**Author:** ![johnv](https://avatars.discourse-cdn.com/v4/letter/j/e47774/32.png) [@johnv](https://community.mappedin.com/u/johnv)\
**Post date:** [September 5, 2024, 7:45pm UTC](https://community.mappedin.com/t/mappedinevent-class-struggling-to-initiate-properly/130/3 "2024-09-05T19:45:21Z")

</div>

Hi Mark.

This worked for me! Thank you for your help.

John
